Regex
Posted: Sun Nov 30, 2014 4:45 pm
Hi,
I'm trying to use regex... and failing miserably. I have read a load of posts here (biggest contributor was Thierry), on Google (mostly StackOverflow) and read the Wikipedia 'how to' article but I still find understanding regex enough to create a simple 'search-for-and-remove-some-text' script eludes me !
I thought that if someone would be good enough to provide some help with my precise requirement I might be able to 'reverse engineer' it and apply the various instructions I've bookmarked to see precisely how the components of the specific regex statement work in my particular case.
An example of my (HTML) text :
<p></p>
<ul type="square">
<li>
<p firstindent="-36" leftindent="36" rightindent="15"><b><font face="Arial" size="12" color="#262626" bgcolor="#FFFFFF">Free App of the Day (FAD) eligibility</font></b><font face="Arial" size="12" color="#262626" bgcolor="#FFFFFF"> If the checkbox labeled <b>Yes, please consider this app for the program</b> is checked (this is the default), Amazon may select your app for this promotional program. If Amazon selects your app for FAD, Amazon will contact you with more details about what to expect as your app goes through the testing and approval process.</font></p>
</li>
</ul><p></p>
An example of what I'm trying to do :
(If I can work out how the regex statement works for this example than I should be able to expand it to do other things - well, that's my idea...
Isolate and remove all instances of, say, the color tag (red, bold text) but for ANY colour/value between the quotes, meaning that :
<p firstindent="-36" leftindent="36" rightindent="15"><b><font face="Arial" size="12" color="#262626" bgcolor="#FFFFFF">
becomes :
<p firstindent="-36" leftindent="36" rightindent="15"><b><font face="Arial" size="12" bgcolor="#FFFFFF">
I figure I can then start to work out the rest...
Can anyone enlighten me please ?
Thanks a million.
Trax.
I'm trying to use regex... and failing miserably. I have read a load of posts here (biggest contributor was Thierry), on Google (mostly StackOverflow) and read the Wikipedia 'how to' article but I still find understanding regex enough to create a simple 'search-for-and-remove-some-text' script eludes me !
I thought that if someone would be good enough to provide some help with my precise requirement I might be able to 'reverse engineer' it and apply the various instructions I've bookmarked to see precisely how the components of the specific regex statement work in my particular case.
An example of my (HTML) text :
<p></p>
<ul type="square">
<li>
<p firstindent="-36" leftindent="36" rightindent="15"><b><font face="Arial" size="12" color="#262626" bgcolor="#FFFFFF">Free App of the Day (FAD) eligibility</font></b><font face="Arial" size="12" color="#262626" bgcolor="#FFFFFF"> If the checkbox labeled <b>Yes, please consider this app for the program</b> is checked (this is the default), Amazon may select your app for this promotional program. If Amazon selects your app for FAD, Amazon will contact you with more details about what to expect as your app goes through the testing and approval process.</font></p>
</li>
</ul><p></p>
An example of what I'm trying to do :
(If I can work out how the regex statement works for this example than I should be able to expand it to do other things - well, that's my idea...

Isolate and remove all instances of, say, the color tag (red, bold text) but for ANY colour/value between the quotes, meaning that :
<p firstindent="-36" leftindent="36" rightindent="15"><b><font face="Arial" size="12" color="#262626" bgcolor="#FFFFFF">
becomes :
<p firstindent="-36" leftindent="36" rightindent="15"><b><font face="Arial" size="12" bgcolor="#FFFFFF">
I figure I can then start to work out the rest...
Can anyone enlighten me please ?
Thanks a million.
Trax.