summaryrefslogtreecommitdiff
path: root/core/java/android/util/Patterns.java
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate Patterns.IP_ADDRESSVictor Chang2020-12-241-0/+7
| | | | | | Bug: 165470548 Test: n/a Change-Id: Ic1e188ea118c87514815ec9581bb158ab66e22e4
* Add "ftp" to the list of URL schemes that get linkified.Fredrik Roubert2020-03-311-1/+1
| | | | | Fixes: 152892738 Change-Id: I888c5b12ebb417309250a25dc70baedad2cf7d7c
* Fix email auto link when there are two chars in local partSiyamed Sinir2017-08-171-1/+1
| | | | | | | | | | | | | | | | Email auto linking used to accept either a single char or more than 2 chars in the local part. Updated the regular expression to accept 1 or more chars. Test: added test to cts.LinkifyTest Test: bit -t CtsTextTestCases:android.text.util.cts.LinkifyTest Test: bit -t FrameworksCoreTests:android.util.PatternsTest Test: bit -t FrameworksCoreTests:android.text.util.LinkifyTest Test: bit -t CtsWidgetTestCases:android.widget.cts.TextViewTest Bug: 64467661 Change-Id: I4e28a344ff1bc50da353b9490eaaec99a751bffb (cherry picked from commit e17c5b478e2446154288d658ef4099a722809dc7)
* Merge "Framework: Ensure image heap string literals for Patterns" am: ↵Andreas Gampe2017-03-071-9/+9
|\ | | | | | | | | | | | | | | d0f092af84 am: 838851364b am: 5fe3eb7696 Change-Id: Ia0bf25c740eedee436436e573241a59685db2fbd
| * Framework: Ensure image heap string literals for PatternsAndreas Gampe2017-03-031-9/+9
| | | | | | | | | | | | | | | | | | | | | | Do not use Pattern.toString to construct complex patterns. Instead, make the string literals explicit so they can be compile-time allocated, thus ending up as clean memory in the image heap. Bug: 34956610 Test: m Test: Device boots Change-Id: I20d45c31243af00168553c218f75fb0795b55149
* | Update autoLink URL regex to match empty path, $ and _Siyamed Sinir2016-04-131-5/+5
|/ | | | | | | | | | | Update URL regular expression to match - path and query that contains dollar sign - domain name that contains underscore - empty path with query parameters. i.e. a.com?q=v Bug: 27436084 Bug: 27501264 Change-Id: I3884624e145ccc1175915327dc2f280ef4e55ce1
* Fix Patterns.UCS_CHAR character classSiyamed Sinir2016-04-111-2/+2
| | | | | | | | | Wrap Patterns.UCS_CHAR character class with brackets. Previously CL Ie6df818dc4d33dfee6ee54432a2231cca51ec423 broke autoLink email and URL patterns while excluding the empty spaces. Bug: 28020781 Change-Id: Ieb7d09cb5e544c1e7cbc1a4d665b979c65e7e773
* Exclude unicode space characters from autoLink URL patternsSiyamed Sinir2016-04-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Excludes the following space characters from autoLink URL patterns: \u00A0: no-break space \u2000: en quad \u2001: em quad \u2002: en space \u2003: em space \u2004: three-per-em space \u2005: four-per-em space \u2006: six-per-em space \u2007: figure space \u2008: punctuation space \u2009: thin space \u200A: hair space \u2028: line separator \u2029: paragraph separator \u202F: narrow no-break space \u3000: ideographic space Bug: 28020781 Change-Id: Ie6df818dc4d33dfee6ee54432a2231cca51ec423
* Email address autolink regex updates.Siyamed Sinir2016-02-251-0/+30
| | | | | | | | | | | This CL updates the email address pattern with: * Local-part should be max 64 characters, and domain should be max 255 characters (it was the opposite before). * Labels in the domain name should be at most 63 characters. * Support non-ascii unicode characters. * Add tests for email address pattern. Bug:9585450 Change-Id: I983f269904ef014ef625417dd08b6509084e6879
* New regular expression to autolink URLsSiyamed Sinir2016-01-041-24/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduced a new regular expression to autolink URLs. Previous regular expression used the protocol as an optional rule. The new expression applies separate rules for strings that do not start with a known protocol and strings that do start with a known protocol. - In order to reuse previous regular expression definitions for different parts of a URL, created constants for different parts of WEB_URL expression. - Separated the test cases for WEB_URL in order to remove the suppress command and make them running again. - Fixed failing tests for punycode urls, which were causing existing tests to fail. - Introduced new a regular expression for URL matching. - Changed the protocol rule to be case insensitive. - Updated IANA TLDs. - Added tests for the new regular expression. - Added tests for Linkify. - Bug 9622849 is partially fixed. Bug: 25727599 Bug: 9622849 Bug: 24500693 Bug: 23189367 Bug: 24543148 Change-Id: Ifd62455d342ca7adb22996246ff652e1d5944bec
* Tune down the linkify false positive rateSelim Gurun2014-04-231-1/+4
| | | | | | | | Bug: 14066316 Tune down the false positive rate by restricting gTLD pattern a little bit. Change-Id: I7bd39633d3267930593bd7231f764c110293301f
* Support for new gTLDsSelim Gurun2014-03-271-21/+30
| | | | | | | | | | | | | | | | Bug: 13006774 Add support for new generic Top-Level Domains (gTLDs) from ICANN and deprecate the public APIs that depend on them. Due to the fast profileration of gTLDs, it has become hard to keep this API up-to-date. Further it already fails to recognize internal domains. We thus replace them with simple "any letter sequence" regexps. This CL is almost same as Ib6cb5360bbb4a02b14bb34acb30d1cc8ddec771b. The difference is that the values of the public gTLD strings are only deprecated and not modified. Change-Id: I37c130ace9068b80eeaec3282a77450517ed7794
* Revert "Support for new gTLDs"Selim Gurun2014-03-261-78/+69
| | | | | | This reverts commit d3ff8bdf92c23d596f3e4701455223f9e3ac8873. Change-Id: I2006c4fcca54a4bc3b680ea0b0600b359cac6ca3
* Support for new gTLDsSelim Gurun2014-03-211-69/+78
| | | | | | | | | | | | Bug: 13006774 Add support for new generic Top-Level Domains (gTLDs) from ICANN and deprecate the public APIs that depend on them. Due to the fast profileration of gTLDs, it has become hard to keep this API up-to-date. Further it already fails to recognize internal domains. We thus replace them with simple "any letter sequence" regexps. Change-Id: Ib6cb5360bbb4a02b14bb34acb30d1cc8ddec771b
* Remove stray logging statement.Narayan Kamath2014-03-111-2/+0
| | | | | bug: https://code.google.com/p/android/issues/detail?id=66974 Change-Id: Ie34c102de143cf6aeb16c78778dda3ef5e928380
* Allow three digit phone numbersBin Zhu2013-02-151-4/+4
| | | | | | | | | | | | The comment for the PHONE pattern says: "<digit><digit|sdd>+<digit>" But the actual pattern requires that the string contains more than that. A phone number should be allowed to be three digits. Change-Id: I86d2f3d634cd0c1654dad9814906f151055dc23a
* Add in i18n TLDs and new TLDs to the URL RegEx matcher.Shimeng (Simon) Wang2011-07-191-6/+6
| | | | | | | also update APIs. issue: 4384739 Change-Id: I946323d80f85fe43338fdc19c5858356faefa6cc
* Updated URL pattern based on http://data.iana.org/TLD/tlds-alpha-by-domain.txtShimeng (Simon) Wang2010-05-071-6/+6
| | | | | | | | | Note: this change doesn't solve the Arabic country code top level domains, which was turned on today. For that, more changes need to be done; probably we need a way to convert the BiDi url to punycode first; then apply this URL pattern. issue: 2663885 Change-Id: I0597fe620c4d44259bff88ecfcbcca1565928c6f
* Revert "Updated URL pattern based on ↵Shimeng (Simon) Wang2010-05-061-6/+6
| | | | | | http://data.iana.org/TLD/tlds-alpha-by-domain.txt" This reverts commit 63b849ef8d6a47422b0f2779f1d9320f6a65d16b.
* Updated URL pattern based on http://data.iana.org/TLD/tlds-alpha-by-domain.txtShimeng (Simon) Wang2010-05-061-6/+6
| | | | | | | | | Note: this change doesn't solve the Arabic country code top level domains, which was turned on today. For that, more changes need to be done; probably we need a way to convert the BiDi url to punycode first; then apply this URL pattern. issue: 2663885 Change-Id: Iac5d16bf9e091a072a59f8244ab6e87940badd4f
* Add good international characters to the path part of Url pattern.Shimeng (Simon) Wang2010-04-271-1/+1
| | | | Change-Id: I05efb7e52a023fcb92db9db2b41dbab2ccca87c7
* Re-arrange android-common so framework no longer links with it.Dianne Hackborn2010-02-251-0/+232
This is the framework part, moving classes around so the framework no longer needs to link to android-common. Makes some APIs public, others that didn't need to be public are private in the framework, some small things are copied.