regular expressions help

Y

YisMan

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
 
J

John Nurick

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!
 
Y

YisMan

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top