[ 
https://issues.apache.org/jira/browse/VALIDATOR-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb closed VALIDATOR-252.
--------------------------


> Performance improvement of DomainValidator by change the regular expression
> ---------------------------------------------------------------------------
>
>                 Key: VALIDATOR-252
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-252
>             Project: Commons Validator
>          Issue Type: Improvement
>          Components: Routines
>    Affects Versions: 1.4.0 Release
>         Environment: Windows 2000 Professional, Pentium4 2.4GHz, RAM:512M, 
> Eclipse 3.3m Junit 3.8.1
>            Reporter: Makoto Uchino
>            Assignee: Ben Speakmon
>            Priority: Minor
>             Fix For: 1.4.0 Release
>
>         Attachments: DomainValidator.java.diff
>
>
> It seemed to take very long time to match the regular expression when long 
> TLD (consists of around 30-characters over TLD) was specified for 
> DomainValidator, this exponential performance will make it appear that the 
> program has hung.
> The match time improves if it is possible to change DOMAIN_LABEL_REGEX from 
> using 
> {noformat}
> (?:) to (?>)
> {noformat}
> as follows.
> {noformat}
> DOMAIN_LABEL_REGEX = "\\p{Alnum}(?>[\\p{Alnum}-]*\\p{Alnum})*"
> {noformat}
> (All unit tests in DomainValidatorTest are succeed even if it changes as 
> shown in the above-mentioned.)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to