Class Overview
Commonly used regular expression patterns.
Summary
Public Methods |
final
static
String
|
concatGroups(Matcher matcher)
Convenience method to take all of the non-null matching groups in a
regex Matcher and return them as a concatenated string.
|
final
static
String
|
digitsAndPlusOnly(Matcher matcher)
Convenience method to return only the digits and plus signs
in the matching string.
|
[Expand]
Inherited Methods |
From class java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Is called before the object's memory is being reclaimed by the VM.
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of Class which represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
|
Constants
public
static
final
Pattern
DOMAIN_NAME
public
static
final
Pattern
EMAIL_ADDRESS
public
static
final
String
GOOD_IRI_CHAR
Good characters for Internationalized Resource Identifiers (IRI).
This comprises most common used Unicode characters allowed in IRI
as detailed in RFC 3987.
Specifically, those two byte Unicode characters are not included.
Constant Value:
"a-zA-Z0-9 -豈-﷏ﷰ-"
public
static
final
Pattern
IP_ADDRESS
public
static
final
Pattern
PHONE
This pattern is intended for searching for things that look like they
might be phone numbers in arbitrary text, not for validating whether
something is in fact a phone number. It will miss many things that
are legitimate phone numbers.
The pattern matches the following:
- Optionally, a + sign followed immediately by one or more digits. Spaces, dots, or dashes
may follow.
- Optionally, sets of digits in parentheses, separated by spaces, dots, or dashes.
- A string starting and ending with a digit, containing digits, spaces, dots, and/or dashes.
public
static
final
Pattern
TOP_LEVEL_DOMAIN
Regular expression pattern to match all IANA top-level domains.
public
static
final
String
TOP_LEVEL_DOMAIN_STR
Regular expression to match all IANA top-level domains.
List accurate as of 2010/02/05. List taken from:
http://data.iana.org/TLD/tlds-alpha-by-domain.txt
This pattern is auto-generated by frameworks/base/common/tools/make-iana-tld-pattern.py
Constant Value:
"((aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(biz|b[abdefghijmnorstvwyz])|(cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(edu|e[cegrstu])|f[ijkmor]|(gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(info|int|i[delmnoqrst])|(jobs|j[emop])|k[eghimnprwyz]|l[abcikrstuvy]|(mil|mobi|museum|m[acdeghklmnopqrstuvwxyz])|(name|net|n[acefgilopruz])|(org|om)|(pro|p[aefghklmnrstwy])|qa|r[eosuw]|s[abcdeghijklmnortuvyz]|(tel|travel|t[cdfghjklmnoprtvwz])|u[agksyz]|v[aceginu]|w[fs]|(xn\-\-0zwm56d|xn\-\-11b5bs3a9aj6g|xn\-\-80akhbyknj4f|xn\-\-9t4b11yi5a|xn\-\-deba0ad|xn\-\-g6w251d|xn\-\-hgbk6aj7f53bba|xn\-\-hlcj6aya9esc7a|xn\-\-jxalpdlp|xn\-\-kgbechtv|xn\-\-zckzah)|y[etu]|z[amw])"
public
static
final
String
TOP_LEVEL_DOMAIN_STR_FOR_WEB_URL
Regular expression to match all IANA top-level domains for WEB_URL.
List accurate as of 2010/02/05. List taken from:
http://data.iana.org/TLD/tlds-alpha-by-domain.txt
This pattern is auto-generated by frameworks/base/common/tools/make-iana-tld-pattern.py
Constant Value:
"(?:(?:aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnprwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdeghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om)|(?:pro|p[aefghklmnrstwy])|qa|r[eosuw]|s[abcdeghijklmnortuvyz]|(?:tel|travel|t[cdfghjklmnoprtvwz])|u[agksyz]|v[aceginu]|w[fs]|(?:xn\-\-0zwm56d|xn\-\-11b5bs3a9aj6g|xn\-\-80akhbyknj4f|xn\-\-9t4b11yi5a|xn\-\-deba0ad|xn\-\-g6w251d|xn\-\-hgbk6aj7f53bba|xn\-\-hlcj6aya9esc7a|xn\-\-jxalpdlp|xn\-\-kgbechtv|xn\-\-zckzah)|y[etu]|z[amw]))"
public
static
final
Pattern
WEB_URL
Regular expression pattern to match most part of RFC 3987
Internationalized URLs, aka IRIs. Commonly used Unicode characters are
added.
Public Methods
public
static
final
String
concatGroups
(Matcher matcher)
Convenience method to take all of the non-null matching groups in a
regex Matcher and return them as a concatenated string.
Parameters
matcher
| The Matcher object from which grouped text will
be extracted |
Returns
- A String comprising all of the non-null matched
groups concatenated together
public
static
final
String
digitsAndPlusOnly
(Matcher matcher)
Convenience method to return only the digits and plus signs
in the matching string.
Parameters
matcher
| The Matcher object from which digits and plus will
be extracted |
Returns
- A String comprising all of the digits and plus in
the match