in reply to Re^5: Regex match at the beginning or end of string
in thread Regex match at the beginning or end of string
That is only one of the constraints specified, which can be verified using @+ & @- after the match.*After* the match? How? Consider the patterns /\w and \d, against the strings &8 and A8. After both
and"&8" =~ /^(?=.*(\w))(?=.*(\d))/;
@- will be (0, 1, 1) and @+ will be (0, 2, 2), yet one of them fits the criteria from the OP, and the other doesn't."A8" =~ /^(?=.*(\w))(?=.*(\d))/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Regex match at the beginning or end of string
by BrowserUk (Patriarch) on Feb 20, 2011 at 12:58 UTC | |
by JavaFan (Canon) on Feb 20, 2011 at 15:25 UTC | |
by BrowserUk (Patriarch) on Feb 20, 2011 at 15:42 UTC | |
by JavaFan (Canon) on Feb 20, 2011 at 15:55 UTC |