I did a regular expression search and replace and it's suppose to be completed but I found a flaw and I'm stuck.
What my search and replace does is, file the 'title' attributes in html tags and convert them to a mouseover javascript. e.g:
I hope you understand the differences in the 4 tags (double quote, single quote, space and slash). My search and replace will make those tags into these:
It works well but the flaw is, when there is an empty title attributes,
It will become this :-
Why?? Because it assumed in the
title="", the second quote is the content which it should take, up to the next quote that arrive, which is href=".
Here's my regular expression code that I've made :-
$1 is the content inside the title attribute and $2 is the end part of it, be it a space, closing angle bracket (>) or a slash.
To further explain my regular explression, the [\"|\'|] will look for the quote in the attributes. The (.+?) gets the content in between the next [\"|\'|]. And the (\s|\>|\/) looks for space, closing angle bracket (>) or slash.
Thanks for your help.. 