View Single Post
  #3 (permalink)  
Old 04-23-2008, 08:22 PM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default 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...
Reply With Quote