News:

Join the Facebook Fan Page.

Main Menu

RegExp Dilemma

Started by A.M.A, September 08, 2004, 07:04:21 AM

Previous topic - Next topic

A.M.A

Hi

Is it possible to RegExp this:
Quote
<span style="font-weight: bold; font-style: italic; text-decoration: underline; color: rgb(255, 102, 102); font-family: arial,helvetica,sans-serif;">myTEXT</span>
to:
[b][i][u][red][font] myTEXT [/b][/i][/u][/red][/font]
I need to omit the ( <span style=" "> ) part and just look for ( font-weight: bold ) , ( font-style: italic; ) , ( text-decoration: underline; ) , ( color: rgb(255, 102, 102); ) or ( font-family: arial,helvetica,sans-serif; ) and replace them with the above code.


and to make it more complicated .. this one:
Quote<font style="color: rgb(255, 102, 102);" size="4"><span style="font-family: arial;">myT<font style="color: rgb(255, 255, 153);" size="6"><span style="font-family: courier new;">E</span></font>XT</span></font>
to:
[COLORa][SIZEa][FONTa] my [COLORb][SIZEb][FONTb] TE [/COLORb][/SIZEb][/FONTb] XT [/COLORa][/SIZEa][/FONTa]

Hope it is not too hard .. I once played with regexp and just remembering the headache it gave me back then .. quit trying to solve this one by myself :)
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

[Unknown]

This would indeed be rather complicated...

-[Unknown]

A.M.A

Quote from: [Unknown] on September 08, 2004, 07:07:01 PM
This would indeed be rather complicated...

-[Unknown]
That's what I was afraid of :(
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

A.M.A

found this wonderful program:
http://www.regexbuddy.com
java , php , perl , c# , vb.net , delphi , python ... am already in love with it :)
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Parham


A.M.A

Quote from: Parham on September 08, 2004, 11:20:31 PM
maybe something a little smaller? (and free)
http://www.weitz.de/regex-coach/
with that program you have to know the regexp that you want to use .. while 'regexbuddy' builds it for you, got good help and a library of ready made regexp.

I'm hoping either you or [Unknown] would solve my request, of course if it is possible  :-\
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Parham

this is one of those hard ones... but it can definitely be done.  if you could give me very clear examples of what input would be, i could create the regex for you.  it wouldn't only be a regex though, it would be a couple of regexes which would use the "e" modifier to execute code on matches.

Advertisement: