J
justin.mayes
hello all -
An example. You have a regular expression to locate certain html tags.
"(<)[^a-z]"
This will find every instance of a "<" character that is not followed
by a letter. The match will include the 2nd character ("<>") wheras
group 1 will just include the "<" character.
when you do a regex.replace it automatically replaces the matches but I
want to just replace group1.
so regex.replace ("<>", "(<)[^a-z]", "x") would match "<>"
and retuen "x" when what i really want is to replace just the < and end
up with "x>" Does that make sense?
thanks for any help provided.
An example. You have a regular expression to locate certain html tags.
"(<)[^a-z]"
This will find every instance of a "<" character that is not followed
by a letter. The match will include the 2nd character ("<>") wheras
group 1 will just include the "<" character.
when you do a regex.replace it automatically replaces the matches but I
want to just replace group1.
so regex.replace ("<>", "(<)[^a-z]", "x") would match "<>"
and retuen "x" when what i really want is to replace just the < and end
up with "x>" Does that make sense?
thanks for any help provided.