in reply to Re: multi-line regexp
in thread multi-line regexp
your code's working here and its looks nice (at least for me), tobe honest i need more times to understand your code, i wish you can explain the process of your code (while i am reading my notes about pattern matching)
Anyway i tried other ways, and so far i made a litle code like :
And the other is :$str = "aa\nbb\ncc\naa\ndd\nee\n"; @a = ($str =~ /aa\n.*\n.*/g); print "1 = $a[0]\n2 = $a[1]\n";
$str = "aa\nbb\ncc\naa\ndd\nee\n"; @a = ($str =~ /(aa.*).?(aa.*)/gs); print "1 = $a[0]\n2 = $a[1]\n";
But anyway, prasadbabu code's nicer, that's why i asked for the explanation, or do you see something bad in my code ?
Update : pKai code simpler and easy to understand for me :)
thanks, zak
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: multi-line regexp
by pKai (Priest) on Dec 21, 2005 at 18:25 UTC |