in reply to RE question: Sentence with a minimum length

You could try something along these lines (untested):
m/\A \s* (\w+\s+\w+?.*?) (??{ length($1) >= 50 }) \s* \z/xs;

(Update: this regex might be very inefficient because both \w+? and .*? might match the same number characters. Use (\w+\s+\w.*?) instead.)

In general that sounds like a problem for which regexes aren't the best solution (split and friends might be better).

Replies are listed 'Best First'.
Re^2: RE question: Sentence with a minimum length
by lima1 (Curate) on Oct 06, 2008 at 08:58 UTC
    Thanks! Yeah, this was also the only way I saw, but I was scared by the experimental warning in perlre. I need a regex here because the API I use requires a regex.