in reply to Regex (lookahead) Confusion
It doesn't pertain to your question but the code:
$string =~ /^[smtwhfa]*$/The * is zero or more, not one or more. For one or more use the + sign. (So it would be /^[smtwhfa]+$/) Unless instead of saying
"A user supplied string may contain 1 or more of the characters smtwhfa in any order."you really meant zero or more. Just a frequent mistake some people make that I thought I would point out.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex (lookahead) Confusion
by ChrisR (Hermit) on Feb 06, 2004 at 13:28 UTC |