Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Soliciting Multiline SIP Searching Suggestions (.*)

by tye (Sage)
on Mar 17, 2008 at 23:38 UTC ( [id://674674]=note: print w/replies, xml ) Need Help??


in reply to Re: Soliciting Multiline SIP Searching Suggestions
in thread Soliciting Multiline SIP Searching Suggestions

/.*?/s isn't enough to prevent that part of the regex from gobbling up multiple lines and also backtracking pathologically. For example, your regex will incorrectly match (after you fix \r \n? to \r? \n or just \n):

From: "Bungalo Bill" ... To: (wrong number) Call-ID: (wrong call) ... From: "Wrong Person" ... To: <sip:66666­66666@...> Call-ID: ThisIsTheWrongCallID

- tye        

Replies are listed 'Best First'.
Re^3: Soliciting Multiline SIP Searching Suggestions (.*)
by kyle (Abbot) on Mar 18, 2008 at 03:15 UTC

    Good catch! If lines do end in \n, the fix is easy. Just remove the /s option. Then /./ won't match the newline. The .* parts match to the end of the line (as they're supposed to) and won't go any further. If lines are terminated in \r, I'd have to change .* to [^\r]* instead.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://674674]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-20 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found