in reply to Re: Regex negative number question
in thread Regex negative number question

You test would still, for example, match "birdie3 -.", which just illustrates why to use Regexp::Common, though ;-).
Cheers,
CombatSquirrel.
Entropy is the tendency of everything going to hell.

Replies are listed 'Best First'.
Re: Regex negative number question
by Abigail-II (Bishop) on Oct 06, 2003 at 22:14 UTC
    Regexp::Common doesn't have a regexp for negative numbers, but you can easily add that yourself. For instance, if you want to match negative decimal numbers, use:
    use Regexp::Common; /(?=-)$RE{num}{decimal}/
    The (?=-) requires the match to start with a minus sign.

    Abigail