in reply to Perl alternation regex looks ok to me?

2|S, in my mind, should have alternated chars 2 or S, not 2 or (0-many other chars) followed by S.

In isolation, yes. But you have used it in combination with other elements without limiting the alternation.

Far easier if you just want alternate characters to use a character class, eg: /^.T[2S]/

HTH.

Replies are listed 'Best First'.
Re^2: Perl alternation regex looks ok to me?
by misterperl (Friar) on Sep 18, 2018 at 15:07 UTC
    thanks I guess a character class might work out.