Mega Code Archive

 
Categories / Ruby / Development
 

Regexps use elements to instruct the regular expression engine on how to find a given string

A combination of the special characters, enclosed by a pair of slashes (//), makes up a regular expression pattern.  ^        Matches the beginning of a line $        Matches the end of a line \w       Matches a word character [...]    Matches any character in the brackets [^...]   Matches any characters not in the brackets *        Matches zero or more occurrences of the previous regexp +        Matches one or more occurrences of the previous regexp ?        Matches zero or one occurrences of the previous regexp