
As a TJ, are there any Dreamweaver monkeys around who can help me with a 'using regular expressions in search and replace' issue?
I've got onClick='javascript: pageTracker._trackPageview('XXXX');' dotted around thousands of pages of website and I need to replace it with onclick='_gaq.push(['_trackEvent', 'XXXX', '<?=$name_id;?>']);' where the XXXX bit remains the same. Anyone know what the syntax is I need to use? I'm thinking I need to escape a bunch of characters but nothing's working so far :(
( ,
Tue 14 Dec 2010, 12:02,
archived)
I've got onClick='javascript: pageTracker._trackPageview('XXXX');' dotted around thousands of pages of website and I need to replace it with onclick='_gaq.push(['_trackEvent', 'XXXX', '<?=$name_id;?>']);' where the XXXX bit remains the same. Anyone know what the syntax is I need to use? I'm thinking I need to escape a bunch of characters but nothing's working so far :(

edit
this works for me using regexr (http://gskinner.com/RegExr/desktop/):
match expression: onClick="javascript: pageTracker._trackPageview\('([A-Z]+)'\);"
replace expression: onclick="_gaq.push(['_trackEvent', '$1', '<?=$name_id;?>']);"
presuming that the XXXX bit is 1 or more alphas
( ,
Tue 14 Dec 2010, 12:33,
archived)
this works for me using regexr (http://gskinner.com/RegExr/desktop/):
match expression: onClick="javascript: pageTracker._trackPageview\('([A-Z]+)'\);"
replace expression: onclick="_gaq.push(['_trackEvent', '$1', '<?=$name_id;?>']);"
presuming that the XXXX bit is 1 or more alphas