in reply to Regex help
/B(?:3[89]|4\d)/ [download]
Thanks much!
CT
(?(?{code}true-regexp) (?(?{code}true-regexp|false-regexp) / B (\d\d) (? (?{ $1 < 38 || $1 > 49 }) # if invalid (?=A)(?=Z) # then fail # else succeed ) /x [download]
It could also have been written:
/ B (\d\d) (?(?{ $1 >= 38 && $1 <= 49 }) # if valid # succeed | # else (?=A)(?=Z) # fail ) /x [download]
(?=A)(?=Z) means the next char must be an 'A' and must be a 'Z'. That's never gonna happen.