in reply to regex to extract text
will do the trick.m/<div class="detailline_address">\s*(.*)</div>/s
"dot" does not match newline unless you add the s-option, meaning you treat the data to be matched as a single string and \n looses its special status.
But of course, one should not deal with HTML through a regexp but using a parser (such as HTML::Parser)
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex to extract text
by jonnyfolk (Vicar) on Jan 18, 2009 at 21:22 UTC | |
by graff (Chancellor) on Jan 19, 2009 at 07:46 UTC | |
|
Re^2: regex to extract text
by pdcawley (Hermit) on Jan 19, 2009 at 17:02 UTC |