regular expressions help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

thank you all in this wonderful group.
a special thanks for introducing me to the wonderful world of regular
expressions

can anybody tell me how to use a simple wildcard in regex?

example myregex.pattern= "hello*goodbye" does not seem to work
 
It depends what you want the pattern to match. As a regex,
hello*goodbye
will match any string that contains "hell" followed by "goodbye", with any
number of "o"s between them, e.g.
hellgoodbye
hellogoodbye
helloooooooooooooooooooooooogoodbye
..
If you want to match any string that begins with "hello" and ends with
"goodbye", use
^hello.*goodbye$

And read the documentation!
 
thanks a million, john.
by the way i tried visiting j.nurick (as you wrote you have collected info
onsite)
but i get a message to come back in a couple of days?
 
Back
Top