public final class UrlRegexRequestMatcher extends java.lang.Object implements WebRequestMatcher
WebRequestMatcher
that allows matching on
WebRequest#getUrl().toExternalForm()
using a regular expression.
For example, if you would like to match on the domain code.jquery.com
,
you might want to use the following.
WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
DelegatingWebConnection
Constructor and Description |
---|
UrlRegexRequestMatcher(java.util.regex.Pattern pattern) |
UrlRegexRequestMatcher(java.lang.String regex) |
Modifier and Type | Method and Description |
---|---|
boolean |
matches(com.gargoylesoftware.htmlunit.WebRequest request)
Whether this matcher matches on the supplied web request.
|
public UrlRegexRequestMatcher(java.lang.String regex)
public UrlRegexRequestMatcher(java.util.regex.Pattern pattern)
public boolean matches(com.gargoylesoftware.htmlunit.WebRequest request)
WebRequestMatcher
matches
in interface WebRequestMatcher
request
- the WebRequest
to attempt to match ontrue
if this matcher matches on the WebRequest