Paul Anderson:

On Mon, Jan 28, 2013 at 03:32:01PM -0500, Paul Anderson wrote:
> I'm thinking {2,}\w to match two or more words after north. 

/{2,}\w/ is not a valid regex. This is what perl will tell you
(if your regex is exactly this and there's nothing in front of it
to unintentionally precede it):

Quantifier follows nothing in regex; marked by <-- HERE in m/{
<-- HERE 2,}/ at -e line 1.

You may have meant /\w{2,}/, but that doesn't match two or more
words. It matches two or more word /characters/. For two words
you'd need something more like /\w+(\W+|$){2,}/ (of course the
definition here of "word" might not match what you're thinking
either so you should reference the docs). Another possible
interpretation might be white-space delimited, as in
/\S+(\s+|$){2,}/. Neither of these regexes have been tested for
errors.

Regards,


-- 
Brandon McCaig <bamcc...@gmail.com> <bamcc...@castopulence.org>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bamccaig.com/>
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'

Attachment: signature.asc
Description: Digital signature

Reply via email to