
FiMko
New User
Sep 25, 2009, 12:11 PM
Post #1 of 3
(5330 views)
|
Problem with regex
|
Can't Post
|
|
Hi all! I have a problem with regex given below. Here is the target text:
Something text TT-AAA-MMMM-1929 Something text 123 Something text Something text 456 Something text I just want to catch "TT-AAA-MMMM-1929" making a start from "123" or "456". So, this regex works in my regex constructor (I don't know what type of engine it is based on) but the perl script finds nothing...
@regexps = ["123", "456"]; for ($i = 0; $i < 2; $i++) { $txt =~ m/TT-AAA-MMMM-\d{4}(?=(.+\r\n)*.+regexps[$i])/g; print($&); } Could anybody help me with this regex? Thanks in advance.
|