in reply to Regular expression to match text between two tags (was: Help!! Regular Expressions)
I dont believe perl's regexes behave like sed(1) or awk(1)'s in that they require flags and modifiers to catch newlines. More information on the tricky $/ is of course in perlvar.my $lineterm = $/; $/ = ''; my $thingy = $_ =~ /:::(.*):::/; $/ = $lineterm;
and of course you should read that book cover to cover. it is extremely helpful. I learned a great deal from that book.
brother dep.
update: me and my itchy trigger finger. well i just spoke to dws in the chatterbox, and while i wasnt able to test this out, he was. apparently the re engine (at least as recently as 5.6) does not care what $/ is set to for the end-of-line character. which means this node isnt quite worthless because, yay, it taught me something. *grumble*
--
Laziness, Impatience, Hubris, and Generosity.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Help!! Regular Expressions
by suaveant (Parson) on Apr 12, 2001 at 16:29 UTC |