?

Log in

No account? Create an account
If your regular expression looks like this: - A Suburbs Boy Living a Country Life [Pete and Pam's pages (photos and some commentary)] [Pam's journal] [Our company] [My Flickr Photos] [Arisia]
August 30th, 2006
01:38 pm

[Link]

Previous Entry Share Next Entry
If your regular expression looks like this:

(?s)<c(:(\w+)\s+(?:(?!>)p)&?('|")((?!>)(?!\3).)&?\$((?!>)(?!\3).)*?\3(?:(?!>).)&.&?(?<!/)>p*?>/c):\2

...you might be doing something wrong.

On the other hand, my replace string looks like:

<c-rt$1-rt:$2

Current Mood: amusedamused

(6 comments | Leave a comment)

Comments
 
[User Picture]
From:eeedge
Date:August 30th, 2006 06:14 pm (UTC)

(Link)
My regular expression looks more like :)
[User Picture]
From:kuritzky
Date:August 30th, 2006 07:05 pm (UTC)
(Link)
This is why perl lets you put comments in regular expressions.
From:mtn_hermit
Date:August 31st, 2006 12:42 am (UTC)
(Link)
Amen. /x is your friend.
[User Picture]
From:happypete
Date:September 6th, 2006 08:35 pm (UTC)

yeah...

(Link)
Eclipse != as RE friendly as Perl
[User Picture]
From:leem0r
Date:August 31st, 2006 03:54 am (UTC)
(Link)
it's almost 12am and that hurts my head to look at and my brain is not functional enough to grok that.
[User Picture]
From:happypete
Date:August 31st, 2006 11:55 am (UTC)

it also looks like LJ's

(Link)
formatting hosed it up..

it's also wrong, because if I have two matching C:whatever tags, the first of which has EL in an attribute, and the second not, it will incorrectly grab the first open tag and the first close tag...

my RE needs to address nested tags--i.e. match the open tag with the attribute of interest, any number of subsequent, identical tags, regardless of whether they are of interest, the SAME NUMBER of closing tags matched inside the original tag, and end by matching the first tag's close...

the hurtiness, it burns....
Pete, Pam and Quinn's pages Powered by LiveJournal.com