I would like to know a function that checks the url of the page, and if it’s a certain URL, take further action. I am not particular skilled with regular expressions, nor do I know if they would be the best way to do what I need.
I’d like to check the URL, but if it changes slightly, a basic location check isn’t sufficient. If the url ends with /# it is the same page. So I need to check using wildcards or other special characters. Conceptually: if url = http://*.domain.com/thingcheckingfor* where the asterisks represent wildcards meaning anything can be where they are.
http://blog.domain.com/page1
http://www.domain.com/page1
http://www.domain.com/page1/#
…all need to be accounted for, hence my desire to use regular expressions.
1 Answer