Re: Ruby Regular Expression The =~ is the match operator.
Basically, what this code does is this:
In the variable johnsays you store a string, which in this case contains a string of chars indicating an hour in standard format also.The variable time stores the pattern to search for: in this case, 2 digits, followed by a semicolon, followed by another 2 digits.Notice you you need to put a forward slash / before the first \d and how you also need to a add a backwards slash after the last \d You need to do this each time you want to place the patterns to search for inside a variable.
__________________ Shaalini.S Be the Best of Whatever you are... |