in reply to Re: Regex partial/leading match
in thread Regex partial/leading match

Thank you, unfortunately that works only for simple strings, not regexes. Consider:
'bated' =~ /^bat{3}/; false 'bated' =~ /^bat/; true
I'm trying to look at the beginning of a string to know if it can potentially match a regex, without knowing the full string. Which is of course different from making a completely different regex with substr($regex.

(Edited for bad examples)