October 1st, 2009, 03:14 AM
Originally Posted by requinix
Think replace, not remove.
s/^define\('([^']+)', '([^']+)'\);/$1, $2/g;
My Perl's a bit weak - that should get you most of the way.
Hi thanks for the reply.
I couldn't get your example work however I took a differant approch and done this:
$re4='((?:[a-z][a-z]+))'; # Word 1
$re6='((?:[a-z][a-z]+))'; # Word 2
if ($txt =~ m/$re/is)
print "($word1) ($word2) \n";
I think my problem was that I wasn't breaking down the string into separate parts