R
Rick Brandt
I am trying to take a string of HTML content and replace some img elements.
I have managed to come up with a Regular Expression that allows me to
replace ALL img elements, but I need to limit the replacement to those img
elements that have a particular src attribute.
I have been Googling and experimenting all morning, but for the life of me I
can't find the key to this. All attempts either match no img elements, all
img elements, or they match all content from the beginning of the first img
element all the way to the close of the final img element.
I guess the basic requirement is a RegExp that matches a string that begins
with a specified string, contains within a specified string, and then ends
with the first occurrence of a specified string.
Up to now I have been using relatively simple RegExps for form validation
and such, but this one has me stumped.
TIA
I have managed to come up with a Regular Expression that allows me to
replace ALL img elements, but I need to limit the replacement to those img
elements that have a particular src attribute.
I have been Googling and experimenting all morning, but for the life of me I
can't find the key to this. All attempts either match no img elements, all
img elements, or they match all content from the beginning of the first img
element all the way to the close of the final img element.
I guess the basic requirement is a RegExp that matches a string that begins
with a specified string, contains within a specified string, and then ends
with the first occurrence of a specified string.
Up to now I have been using relatively simple RegExps for form validation
and such, but this one has me stumped.
TIA