I have the following RegEx
id=(.*?) | id='(.*?)'
The reason for this is I am trying to replace Ids from the browsers DOM using JavaScript. IE, however strips quotes from element atributes as it appears not to require them in the DOM
The problem I have is that the backrefererences from each alternate statement are in separate groups ($1 and $2) as the match is only one OR the other can I return both the backreference as a single backreference?
EDIT:
<div id='test1' /><div id=test2 />
will match as follows
match | $1 | $2 -------------------------------- id='test1' | test1 | id=test2 | | test2
I just want both backreferences to be added to $1
1 Answer