in reply to multi-line regexp
If i understood your question correctly, this will work.
'.' matches newline character when you use the 's' option modifier in your regex. Also take a look at perlre.
#! /usr/bin/perl $str = "aaaaa\nbbbbb\nccccc\naaaaa\nddddd\neeeee\n" ; @a = $str =~ /aaaaa(?:(?!aaaaa).)*/gs ; print "$a[0]\n$a[1]" ;
updated: removed extra grouping.
Thanks in advance
Prasad
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: multi-line regexp
by jeanluca (Deacon) on Dec 21, 2005 at 11:34 UTC | |
by prasadbabu (Prior) on Dec 21, 2005 at 11:40 UTC | |
by blazar (Canon) on Dec 22, 2005 at 09:38 UTC | |
by l3v3l (Monk) on Dec 21, 2005 at 17:42 UTC | |
by doctor_moron (Scribe) on Dec 23, 2005 at 11:23 UTC | |
by doctor_moron (Scribe) on Dec 23, 2005 at 11:06 UTC | |
|
Re^2: multi-line regexp
by doctor_moron (Scribe) on Dec 21, 2005 at 17:38 UTC | |
by pKai (Priest) on Dec 21, 2005 at 18:25 UTC |