deutsch

Regex – can you read it?

Does anyone know what this does?
/<a[^>]*href="([^"]*trackback[^"]*)"[^>]*>
.*<\/a>|<a[^>]*href="([^"]*)"[^>]*>[^<]*
trackback[^<]*<\/a>/siU

This entry was posted on Thursday, October 25th, 2007 at 5:56 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Michael says:

Looks like it’s capturing the href-value of any anchor-link that has ‘trackback’ anywhere in either the href value itself (ie. inside the quotes) or in the content of the link? (case-insensitive, multi-line, but I’m not sure about the U – unicode case-insensitivity??)

Makes you appreciate verbose regex expressions with inline comments doesn’t it?! (Like Python’s verbose regex syntax)

October 26th, 2007 at 10:29 pm

jerk says:

Dear,

U means ungreedy…

October 29th, 2007 at 9:39 am

Leave a Reply