MemoryRefresh!

Egrep / Optional items     Optional items



Questions Answers 0%

Pages   0 from 15
Questions   0 from 20

Reset


Question mark
Question mark in /colou?r/ means "optional". It is placed after the character that is optional (might appear but isn't required).
Always successful
The u? part is always successful. This isn't to say that any regex that contains ? is always successful. For example, in /colou?r/ against "semicolon", both "colo" and "u?" are successful, but r fails, so the whole regex fails.
Paranthesses
Grouping for ? (and other similar metacharacters) is one of the main uses of parantheses. For example /4th|4/ can be simplify to /4(th)?/
1) Which character is optional in colou?r




2) A regex containing optional metacharacter is always successful?




3) What is one of the main uses of parantheses?







Question mark
Question mark in /colou?r/ means "optional". It is placed after the character that is optional (might appear but isn't required).
Always successful
The u? part is always successful. This isn't to say that any regex that contains ? is always successful. For example, in /colou?r/ against "semicolon", both "colo" and "u?" are successful, but r fails, so the whole regex fails.
Paranthesses
Grouping for ? (and other similar metacharacters) is one of the main uses of parantheses. For example /4th|4/ can be simplify to /4(th)?/

References









Programming

Php
   
Regex
   
MySQL
   
Css
   
jQuery
   
Git
   


References