File tree Expand file tree Collapse file tree
core/src/main/java/com/opensymphony/xwork2/validator/validators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,17 +48,17 @@ public class URLValidator extends FieldValidatorSupport {
4848
4949 private static final Logger LOG = LogManager .getLogger (URLValidator .class );
5050
51- public static final String DEFAULT_URL_REGEX = "^(?:https?|ftp):/ /" +
51+ public static final String DEFAULT_URL_REGEX = "^(?:https?|ftp):\\ / \\ /" +
5252 "(?:(?:[a-z0-9$_.+!*'(),;?&=\\ -]|%[0-9a-f]{2})+" +
5353 "(?::(?:[a-z0-9$_.+!*'(),;?&=\\ -]|%[0-9a-f]{2})+)?" +
5454 "@)?#?" +
5555 "(?:(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\ .)*" +
5656 "[a-z][a-z0-9-]*[a-z0-9]" +
5757 "|(?:(?:[1-9]?\\ d|1\\ d{2}|2[0-4]\\ d|25[0-5])\\ .){3}" +
58- "[1-9]?\\ d|1\\ d{2}|2[0-4]\\ d|25[0-5]" +
58+ "(?: [1-9]?\\ d|1\\ d{2}|2[0-4]\\ d|25[0-5]) " +
5959 ")(?::\\ d+)?" +
60- ")(?:(?:/(?:[a-z0-9$_.+!*'(),;:@&=\\ -]|%[0-9a-f]{2})*)*" +
61- "(?:\\ ?(?:[a-z0-9$_.+!*'(),;:@&=\\ -/:]|%[0-9a-f]{2})*)?)?" +
60+ ")(?:(?:\\ /(?:[a-z0-9$_.+!*'(),;:@&=\\ -]|%[0-9a-f]{2})*)*" +
61+ "(?:\\ ?(?:[a-z0-9$_.+!*'(),;:@&=\\ -\\ /:]|%[0-9a-f]{2})*)?)?" +
6262 "(?:#(?:[a-z0-9$_.+!*'(),;:@&=\\ -]|%[0-9a-f]{2})*)?" +
6363 "$" ;
6464
You can’t perform that action at this time.
0 commit comments