in reply to Reg Ex help

unless (my @words = /(\b\D+?\b)/g) { print "Houston, we have a problem.\n"; }

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re: Re: Reg Ex help
by runrig (Abbot) on Sep 12, 2001 at 20:40 UTC
    That doesn't work. He doesn't want to match at all if theres any digits anywhere in the string (or so he says :). Try "abc 123" just for example. Sometimes its just not worth trying to do something in one regex, but you could simplify to this:
    unless (tr/0-9//) { my @words = /\w+/g; print "@words\n"; }
      No, it's not identical. But, I suspect, it's closer to the spirit of what he's doing...

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.