Browse by Tags

All Tags » regex (RSS)

RegEx Pattern - Determining the name of the page by Palermo4

[.+]?/(?<pagename>[^/]+).aspx If the only thing necessary is to determine the name of the page (without path information) this regex pattern did the job for me.
Filed under: ,

Regex pattern for anchor tags (part 2) by Palermo4

Thanks to a comment by Jerry Pisk, I have revised the RegEx pattern to allow the anchor tag to include other attributes as well. Here is the revision: <a.*href=["'](?<url>[^"]+[.\s]*)["'].*>(?<name>[^<]+[.\s]*)</a>
Filed under: ,

RegEx pattern for anchor tags by Palermo4

Scott Cate just wrote a blog on his first (from scratch) RegEx pattern to find anchor <a> tag. Here is my revision: <a[\s]?href=["'](?<url>[^"]+[.\s]*)["']>(?<name>[^<]+[.\s]*)</a> I simply added support for the href value...
Filed under: ,
More Posts