Monster perl regex
I'm trying to change strings like this:

    <a href='../Example/case23.html'><img src='Blablabla.jpg'

To this:

    <a href='../Example/case23.html'><img src='<?php imgname('case23'); ?>'

And I've got this monster of a regular expression:

    find . -type f | xargs perl -pi -e \
      's/<a href=\'(.\.\.\/Example\/)(case\d\d)(.\.html\'><img src=\')*\'/\1\2\3<\?php imgname\(\'\2\'); \?>\'/'

But it isn't working. In fact, I think it's a problem with Bash, which could probably be pointed out rather quickly.

    r: line 4: syntax error near unexpected token `('
    r: line 4: `  's/<a href=\'(.\.\.\/Example\/)(case\d\d)(.\.html\'><img src=\')*\'/\1\2\3<\?php imgname\(\'\2\'); \?>\'/''

But if you want to help me with the regular expression that'd be cool, too!
Monster perl regex
===

I'm trying to change strings like this:

    <a href='../Example/case23.html'><img src='Blablabla.jpg'

To this:

    <a href='../Example/case23.html'><img src='<?php imgname('case23'); ?>'

And I've got this monster of a regular expression:

    find . -type f | xargs perl -pi -e \
      's/<a href=\'(.\.\.\/Example\/)(case\d\d)(.\.html\'><img src=\')*\'/\1\2\3<\?php imgname\(\'\2\'); \?>\'/'

But it isn't working. In fact, I think it's a problem with Bash, which could probably be pointed out rather quickly.

    r: line 4: syntax error near unexpected token `('
    r: line 4: `  's/<a href=\'(.\.\.\/Example\/)(case\d\d)(.\.html\'><img src=\')*\'/\1\2\3<\?php imgname\(\'\2\'); \?>\'/''

But if you want to help me with the regular expression that'd be cool, too!