| Author |
Regular expression pattern
|
Vivek Alampally
Ranch Hand
Joined: Jul 10, 2008
Posts: 65
|
|
Hi
What does the regular expression
/(hot)? ?donuts/ mean?
How is it different from /(hot)? donuts/ ?
Thanks
Vivek.
|
 |
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1028
|
|
The first one covers an optional blank " ?" between the optional "hot" and donuts.
|
 |
Vivek Alampally
Ranch Hand
Joined: Jul 10, 2008
Posts: 65
|
|
|
Thanks Chris for your prompt reply. But i didnt get what you are trying to say. Can you please give me an example illustrating the difference between two regular expressions?
|
 |
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1028
|
|
Hi Vivek,
i haven't testet it, but it looks like
/(hot)? ?donuts/ finds "hot donuts", "hotdonuts", " donuts" and "donuts",
/(hot)? donuts/ finds "hot donuts" and " donuts"
|
 |
Vivek Alampally
Ranch Hand
Joined: Jul 10, 2008
Posts: 65
|
|
|
Ok I got it. Thank you so much.
|
 |
 |
|
|
subject: Regular expression pattern
|
|
|