This is the input:
<html:text styleId="dateDue" property="newFee.dateDueString" maxlength="10"
onkeyup="autoFormatDate(this, event)" size="10" onkeypress="digitsOnly()"
onfocus="clearTextField(this)" onchange="dude()" />
My Reg expression is:
onkeyup\s*=\s*"autoFormatDate\s*\(this\s*,\s*event\)"[.\s]*onchange\s*=\s*"(.*)"[.\s]*\/>
I am trying to replace the following
<html ....
onkeyup="autoFormatDate(this, event)"
.....
onchange="dude()"
... />
with
<html ....
onkeydown="autoFormatDate(this, event)"
.....
onchange="newDude(); dude()"
... />
In brief, onkeyup replaced with onkeydown and onchange got one more function/script added. There might be anything including line breaks between this onkeyup and onchange properties in a tag. Another thing is I want to replace/update onchange only if the tag also contains onkeyup="autoformat...".
other points
We can assume onchange is going to follow onkeyup in a tag. This line breaks are the complicated ones that I could not get it matched. I am not sure how to make it restricted to one tag at a time instead of the situation "begining matches one tag and ending matches next tag".
With the above, this does not match my Reg expression.
Thanks
<html:text styleId="dateDue" property="newFee.dateDueString" maxlength="10"
onkeyup="autoFormatDate(this, event)" size="10" onkeypress="digitsOnly()"
onfocus="clearTextField(this)" onchange="dude()" />
My Reg expression is:
onkeyup\s*=\s*"autoFormatDate\s*\(this\s*,\s*event\)"[.\s]*onchange\s*=\s*"(.*)"[.\s]*\/>
I am trying to replace the following
<html ....
onkeyup="autoFormatDate(this, event)"
.....
onchange="dude()"
... />
with
<html ....
onkeydown="autoFormatDate(this, event)"
.....
onchange="newDude(); dude()"
... />
In brief, onkeyup replaced with onkeydown and onchange got one more function/script added. There might be anything including line breaks between this onkeyup and onchange properties in a tag. Another thing is I want to replace/update onchange only if the tag also contains onkeyup="autoformat...".
other points
We can assume onchange is going to follow onkeyup in a tag. This line breaks are the complicated ones that I could not get it matched. I am not sure how to make it restricted to one tag at a time instead of the situation "begining matches one tag and ending matches next tag".
With the above, this does not match my Reg expression.
Thanks