November 2005
Intermediate to advanced
304 pages
6h 14m
English
In the previous section, we saw how to use a regular expression to search within a document to retrieve all the URLs inside it. We were able to retrieve the matching URL Strings using the find, start, and end methods of the Matcher class. Sometimes it's necessary to further process the results of a matching substring, perhaps looking for an additional subpattern. For example, you might decide not to process URLs from particular domains. The brute force approach is to use another Pattern and Matcher object for this purpose, by writing code something like this:
// assume urlMatcher instance as in ...
Read now
Unlock full access