in reply to Re^6: Reg Exp to handle variations in the matched pattern
in thread Reg Exp to handle variations in the matched pattern
All I've done is wrap tags around the found object and stick in a global modifier. replace the search regex and tags with whatever you want to tag. It won't quite work around your line breaks, but you can start from there.open(MYINPUTFILE, "<sdnew02.txt"); while (<MYINPUTFILE>){ $_ =~ s/(\s-)$/\<tag\>$1<\/tag\>/g; $_ =~ s/(:)$/\<tag\>$1<\/tag\>/g; print $_,""; }
|
|---|