in reply to regular expression for getting text between 1. and 2.
check this
while(<DATA>) { chomp; if (/^1[.)](.*?)2[.)]$/) { print"matched $1\n"; } else{ print "not matched \n"; } } __DATA__ 1. 2.10.10.20 some text 2. 1) 2.10.10.20 2)
|
---|
In Section
Seekers of Perl Wisdom