Search This Blog

Tuesday, July 2, 2013

Regular Expressions

"\s/Content/"           space and then Content directory
"([a-zA-Z0-9\-]+?)  group of alphanumeric characters and hyphen
?                              don't be greedy, match lazily.
\.aspx                      file extension required for match
\b                             Word break: Matches where a word starts.
[a-z]                        Matches any lowercase ASCII letter.
                                We only need to match words with lowercase first letters.
                                This is a character range expression.
\w+                         Word characters:
                                Matches must have one or more characters.
"\d"                         metacharacter matches digit characters
\s+                         use a pattern to change multiple spaces to single spaces. The     characters \s+ come in handy.
"$"                          we use the "$" metacharacter to match the string end.
^                              Use the ^ to always match at the start of the string.
\s                             Then, look through all WHITESPACE characters with \s
+                              Use + to look through more than 1 characters
\W                           uppercase word

No comments :