November 2005
Intermediate to advanced
304 pages
6h 14m
English
The section "Staying Regular: Using Regular Expressions to Search Text" at the beginning of this chapter describes how to use a regex pattern to compare whether a String matches (or partially matches) a given pattern, starting from the beginning of the input String. In this section, we'll be using regex patterns to find multiple matching values within a String. As an example, we'll search within a document to find any URLs embedded in the text. First, we'll need a pattern String that matches URLs. Here is one pattern that will match most URLs in common usage:
String urlString = ...
Read now
Unlock full access