Re: Ruby Regular Expression {m,n} at least m and at most n repetitions of the preceding
? at most one repetition of the preceding; same as {0,1}
| either preceding or next expression may match
() grouping
The main reason regular expressions exist is this: if you want your program to check if "something" looks like something else, in terms of similar characters or spacing or lenght or many many other things you might think of, you use a regular expression. The table above will give you a concise view of all Ruby's regular expression elements.
__________________ Shaalini.S Be the Best of Whatever you are... |