Gossamer Forum
Home : General : Perl Programming :

Darn regex :(

Quote Reply
Darn regex :(
Hi,

I don't suppose anyone has any ideas why this regex isn't working?

Sample HTML:

<span
lang=EN-GB style='font-size:7.5pt;font-family:Verdana;color:#CCFFFF'>raYIbZlPS
Visit coursework ge in ge fo ge for ge more paper ge Do ge not ge redistribute
raYIbZlPS</span>

Code:

Code:
$desc =~ s|\Q<span\E[\n\s+]\Qlang=EN-GB\E[\n\s+]\Qstyle='font-size:\E[\n\s+]\Q7.5pt;font-family:Verdana;\E[\n\s+]\Qcolor:#CCFFFF'>\E([\W\w\d\s\n]+?)\Q</span>\E||ig;

Its really annoying me. Basically, the format can look anything like;

Quote:
<span
lang=EN-GB style='font-size:7.5pt;font-family:Verdana;color:#CCFFFF'>cocf cfr
secfcfw orcf cfk incf focf cf!</span>


<span
lang=EN-GB style='font-size:7.5pt;font-family:Verdana;color:#CCFFFF'>cocd cdr
secdcdw </span>

<span lang=EN-GB style='font-size:7.5pt;font-family:
Verdana;color:#FFCCFF'>VgODf6j4 from VgODf6j4 coursewrok VgODf6j4 work VgODf6j4
info VgODf6j4 </span>


<span lang=EN-GB
style='font-size:7.5pt;font-family:Verdana;color:#CCFFFF'>11u2737Yu Visit
coursework gd in gd fo gd for gd more paper gd Do gd not gd redistribute
11u2737Yu</span>

<span
lang=EN-GB style='font-size:7.5pt;font-family:Verdana;color:#CCFFFF'>cogb gbr
segbgbw orgb gbk ingb fogb gb;</span>

Note how the newlines are different on each of them. I have a feeling this is whats causing the problem :(

The idea behind this code, is to remove all tags that look like;

Code:
<span
lang=EN-GB style='font-size:7.5pt;font-family:Verdana;color:#CCFFFF'>CONTENT</span>

..and;

Code:
<span
lang=EN-GB style='font-size:7.5pt;font-family:Verdana;color:#FFCCFF'>CONTENT</span>


Anyone got any suggestions? Smile

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Darn regex :( Andy 8621 Mar 15, 2005, 3:35 AM
Thread Re: [Andy] Darn regex :(
Wil 8493 Mar 15, 2005, 6:48 AM
Thread Re: [Wil] Darn regex :(
Andy 8382 Mar 15, 2005, 7:15 AM
Thread Re: [Andy] Darn regex :(
Wil 8424 Mar 16, 2005, 2:54 AM
Thread Re: [Wil] Darn regex :(
Andy 8369 Mar 16, 2005, 3:27 AM
Post Re: [Andy] Darn regex :(
webmaster33 8357 Mar 16, 2005, 4:29 AM
Post Re: [Andy] Darn regex :(
Optic 8366 Mar 23, 2005, 5:36 PM
Post Re: [Andy] Darn regex :(
NamedRisk 8289 Apr 28, 2005, 12:08 PM