replace two characters within a markup tag
Posted: Wed Jun 17, 2009 3:04 am
Believe me, I've been trying!
Attempting a a search & replace using regular expressions so that:
<color>FFFF00FF</color>
becomes:
<color>7FFF00FF</color>
The first 2 characters must become "7F" - but the remaining 6 characters should remain the same.
The colour will vary - so the regular expression should FIND anything within the color tag!
My FIND attempt - /<color>.{8}<\/color>/ - certainly doesn't work!
Preferences set to POSIX.
Attempting a a search & replace using regular expressions so that:
<color>FFFF00FF</color>
becomes:
<color>7FFF00FF</color>
The first 2 characters must become "7F" - but the remaining 6 characters should remain the same.
The colour will vary - so the regular expression should FIND anything within the color tag!
My FIND attempt - /<color>.{8}<\/color>/ - certainly doesn't work!
Preferences set to POSIX.