Forum Discussion
hooleylist
Dec 03, 2007Cirrostratus
Here is a sample of hrefs I assume you don't want to check:
refs to keep
And here is a list of hrefs you do want to compare against the class:
refs to potentially mask out
description
description
description
Jump to the Useful Tips Section
This regex matches all in the list to compare and none in the list not to check:
(?si).*?
Here is an explanation of the tokens from RegexBuddy:
Match the remainder of the regex with the options: dot matches newline (s); case insensitive (i) «(?si)»
Match the characters "Match a single character that is a "whitespace character" (spaces, tabs, line breaks, etc.) «\s»
Match a single character present in the list below «[\w"'=]*?»
Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Match a single character that is a "word character" (letters, digits, etc.) «\w»
One of the characters ""'=" «"'=»
Match the characters "href" literally «href»
Match a single character that is a "whitespace character" (spaces, tabs, line breaks, etc.) «\s?»
Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
Match the character "=" literally «=»
Match a single character present in the list below «[\s'"]?»
Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
Match a single character that is a "whitespace character" (spaces, tabs, line breaks, etc.) «\s»
One of the characters "'"" «'"»
Match the characters "http" literally «http»
Match the character "s" literally «s?»
Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
Match the characters "://" literally «://»
Match any single character that is not a line break character «.*?»
Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Match the character ">" literally «>»
Match any single character that is not a line break character «.*?»
Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Match the characters "" literally «»
I didn't test this extensively. If it doesn't work for you, can you give more examples on what you do/don't want to match?
Thanks,
Aaron