Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: regex to extract text

by pdcawley (Hermit)
on Jan 19, 2009 at 17:02 UTC ( #737331=note: print w/replies, xml ) Need Help??


in reply to Re: regex to extract text
in thread regex to extract text

A small point of style, but

m{(?s)<div class="detailline_address">\s*(.*?)</div>}
avoids endweight problems by pushing the modifier up front. There's also the case for always using (?msx) at the beginning of your regexes unless there's a damned good reason not to. In this case, the damned good reason not to is: "You're attempting to parse XML with a regular expression! Are you mad?"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://737331]
help
Chatterbox?
[atcroft]: .oO(Then again, you also have to be careful if you had it to the database, and be aware of any assumptions it makes (such as SQLite assuming Gregorian calendar and a day of exactly 86400 seconds)...)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2017-04-29 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.