regex

Aug 18, 2007 17:23

I was looking through some PHP code I'd written a while ago (specifically a CMS with an extensive tag engine), and I came across a regular expression that reduced 60~ lines of PHP loops, conditionals, etc. to one line.


Read more... )

Leave a comment

Comments 4

O rly asteriskk August 19 2007, 01:29:17 UTC
What do we win?

Reply


the_new_lemon August 19 2007, 14:27:49 UTC
The regex is looking for an opening paragraph tag with css attribute, alphanumeric text, and a closing paragraph tag. What I don't quite understand is that the opening tag has a closing forward slash, like this:
. This implies that your function processes XHTML markup, but as far as I know paragraph tags in XHTML don't need the closing slash.

I await my prize.

Reply

WRONG the_bishop August 19 2007, 15:28:27 UTC
It's looking for special tags that are to be parsed out and replaced at runtime.

An example would be:

... )

Reply

Re: WRONG the_new_lemon August 19 2007, 15:52:20 UTC
Well, still close enough for a prize, I'd say!

Reply


Leave a comment

Up