in reply to Re^3: Regex help
in thread Regex help
(?(?{code}true-regexp) (?(?{code}true-regexp|false-regexp) / B (\d\d) (? (?{ $1 < 38 || $1 > 49 }) # if invalid (?=A)(?=Z) # then fail # else succeed ) /x
It could also have been written:
/ B (\d\d) (?(?{ $1 >= 38 && $1 <= 49 }) # if valid # succeed | # else (?=A)(?=Z) # fail ) /x
(?=A)(?=Z) means the next char must be an 'A' and must be a 'Z'. That's never gonna happen.
In Section
Seekers of Perl Wisdom