Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^2: regular expression assistance

by chip (Curate)
on May 10, 2008 at 00:43 UTC ( #685803=note: print w/replies, xml ) Need Help??

in reply to Re: regular expression assistance
in thread regular expression assistance

Sadly that pattern misinterprets 100100100100 as a valid IP.

At the very least you'd want to replace \.? with (?:\.|\z) or the like.

    -- Chip Salzenberg, Free-Floating Agent of Chaos

Replies are listed 'Best First'.
Re^3: regular expression assistance
by GrandFather (Sage) on May 10, 2008 at 01:35 UTC

    There are many ways of breaking the pattern. Most of them can't be resolved without knowing the nature of the strings being matched.

    The intent was to demonstrate a way of including the range test in the match rather than to strictly match IP number strings and nothing else. So don't be sad, learn from the technique and be happy. ;)

    Perl is environmentally friendly - it saves trees

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://685803]
[perldigious]: No offense to any Scotsman, I love Scots. Well actually, I love Scotch, but I'm sure the people are great too. :-P
[Discipulus]: perldigious i understand i word on ten, to be optimistic..
LanX will try to give his next LPW talk with a Cogney intonation
[Discipulus]: if you love Scotch in scotland your safety will be.. glengranted
[LanX]: *Cockney
erix tries for a few glo'al stops
[Discipulus]: or was Cognac (in|s)tonation?

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2017-06-23 16:53 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (552 votes). Check out past polls.