Hello fellow grasshoppers and zen masters,
I have a question regarding the searching data that is allowed to be inputed. The requirements state that that the flex should be "flexible" that being nice and
vague makes things about as crystal clear as poo poo. Here is where I'm going with all of this....
Should we account for the meta characters, groupings, etc as part of the searching critieria or is it enough to not allow the user to enter the characters? Or.... do you need to pad the metacharacters appropriatly?
MetaCharacters and the good old back slash of hell:
Character What it represents Example
Any Represents the character typed, with the exception of special characters defined below A represents A, B represents B etc
. Any character(except line breaks) Will match c, 3, [SPACE] etc
\d Any digit Will match 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9
\D Any non-digit Will match anything except 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9
^ Beginning of line
$ End of line
\t [TAB] \thello matches "hello" preceded by a tab
\r Line Break [RETURN]
\s Whitespace Matches any whitespace character: [SPACE], [TAB], Line Break, New Line
\S Non whitespace Matches any non whitespace character
\w
Word characters Typically letters, numbers and underscores
\W Non word characters Matches any non word character
\character A character that is normally a special character Special characters are: . # ^ $ \ ? + * | [ ] ( )
[any series of characters] Any characters inside the brackets [abc] matches a, b or c
[any character - another character] Any characters within the range of characters [a-c] matches a, b or c
[^ any series of characters] Any character except ones after the ^ [^c3] matches any character except c or 3
? 0 or 1 of the previous character ba?t matches bat or bt, but not boat
* 0 or more of the previous character ba*t matches bt, bat, baat etc
+ 1 or more of the previous character ba+t matches bat, baat etc but not
Easy question, right?