URL Pattern Matching
WebScout lets you use powerful regular
expressions to match any URL. The following
are examples of patterns that match different
URLs. If you need help matching a URL, contact
us and we will gladly help.
Matching a web site
Problem: Match the web site www.something.com.
Solution: www\.something\.com
Matching a directory
Problem: Match the "images" folder on any
web site.
Solution: /images/
Matching a filename
Problem: Match the file "sample.jpg".
Solution: sample\.jpg
Matching a file extension
Problem: Match any MP3 file (*.mp3).
Solution: \.mp3
Matching a whole keyword
Problem: Match the whole keyword "sample",
but not "samples".
Solution: \Wsample\W
Matching a web site prefix
Problem: Match any web site that starts with "ads.".
For example, ads.something.com.
Solution: http://ads\.
Note: The period character has a special meaning
in regular expressions; it means "any character"
which is similar to the question mark in DOS. To match the
literal period character, you must preceed the period with
a backslash. That is why in the above examples you see the
backslash followed by the period.
|