If I have a string that is this
<f = x1106f='0'>something
and The values inside <> can change How would I use regular expressions to isolate "something" and replace the tag?
EDIT:
<(.*?)> Pattern worked
If I have a string that is this
<f = x1106f='0'>something
and The values inside <> can change How would I use regular expressions to isolate "something" and replace the tag?
EDIT:
<(.*?)> Pattern worked
Use the following regex to capture "something":
(?<=>)(.*?)(?=<)
assuming that after "something" there's a closing tag.
Link to fiddle
> and precedes a </. However, this regexp would provide the same match: >(.*)<\/. Also, the .* would be overly greedy - a .*? is safer - or even better [^<]* (e.g. if the string were <f = x1106f='0'>something</f><f = asdf>somethingelse</f>, the match would be something</f><f = asdf>somethingelse).