galaganut Posted September 14, 2005 Posted September 14, 2005 Hello, I have a great regex for extracting hrefs from a web page, but I can not figure out where I can insert one of my submatch conditions. Here is the regex that matches the href link. (?:[hH][rR][eE][fF]\s*=)(?:[\s""']*)(?!#|[Mm]ailto|[lL]ocation.|[jJ]avascript|.*css|.*this\.)(.*?)(?:[\s>""']) and here is another regex that matches part of the link: W0QQitemZ([0-9]{5,10})QQ Where in the first regex do I enter this one in order to get the following submatch? Text: <html><a href=""http://cgi.ebay.com/YAMAZAKI-Gold-Accent-CARA-Soup-Spoon-Spoons-NEW_W0QQitemZ4358700777QQcategoryZ38242QQrdZ1QQcmdZViewItem""></html> Match: http://cgi.ebay.com/YAMAZAKI-Gold-Accent-CARA-Soup-Spoon-Spoons-NEW_W0QQitemZ4358700777QQcategoryZ38242QQrdZ1QQcmdZViewItem SubMatch: 4358700777 Thanks in advance, Chuck Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.