I want to get all the "a" elements with the href attribute in this form: http(s)://any.example.com where any can be a string containing just letters and/or numbers. I'm new to regex and XPath so i can't get it right. I figured it out the regex but i'm not sure if it's 100% correct: Code:
/(http|https)://+[A-Za-z0-9]+\.example+\.+com/
So the XPath would look like this: Code:
document.evaluate( "//a[@href='/(http|https)://+[A-Za-z0-9]+\.google+\.+com/']" , document , null , XPathResult.ORDERED_NODE_SNAPSHOT_TYPE , null );
but it doesn't work.
I would appreciate if someone could help me.