Kevin, Era... You're right! Sorry... But not
SQLstr =~ s/(FROM | from)... either as that would capture that part of the match which is unnecessary... The case insensitive version looks the most elegant (i.e., /from\s(\w+)\./i
, and yes I forgot that the /e (evaluate) at the end works with the substitution, not the pattern
Also yes, in the real world, any of the SQL statement could be on one or many lines.... I don't know if using "s" following the substitution (which allows "." to match newlines -- s/pattern/substitution/s) would help, or perhaps you can't really do this with a simple pattern sub...
Been playing with some of this a lot lately... Seem to have time on my hands and that's both good and bad....