struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LukaszRacon <...@git.apache.org>
Subject [GitHub] struts pull request: Email validation blocks upper case letters
Date Thu, 12 Nov 2015 15:32:38 GMT
Github user LukaszRacon commented on the pull request:

    https://github.com/apache/struts/pull/56#issuecomment-156139393
  
    I updated PR with a shorter literal regexp notation.
    
    `"/regexString/i"` will not work since it would be converted by str.match function to
RegExp object
    `new RegExp("/regexString/i")` while we need RegExp with a case-insensitive flag: `new
RegExp("regexString", "i")`
    
    So in this case we could use:
    ```
    fieldValue.match(new RegExp("${validator.regex?js_string}", "i"))==null
    ```
    or shorter version:
    ```
    fieldValue.match(/${validator.regex}/i)==null
    ```
    I also fixed url validation that used incorrect RegExp. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message