You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Paul Gier (JIRA)" <ji...@codehaus.org> on 2012/11/23 16:39:13 UTC

[jira] (MENFORCER-139) Regex rule example is incorrect; matching is not described

     [ https://jira.codehaus.org/browse/MENFORCER-139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Gier updated MENFORCER-139:
--------------------------------

    Priority: Minor  (was: Major)
    
> Regex rule example is incorrect; matching is not described
> ----------------------------------------------------------
>
>                 Key: MENFORCER-139
>                 URL: https://jira.codehaus.org/browse/MENFORCER-139
>             Project: Maven 2.x Enforcer Plugin
>          Issue Type: Bug
>          Components: Standard Rules
>         Environment: http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html
>            Reporter: SebbASF
>            Assignee: Paul Gier
>            Priority: Minor
>             Fix For: 1.2
>
>
> The documentation page [1] has an example rule containing:
> {noformat}
> <regex>\d</regex>
> <regexMessage>You must have a digit in your baseDir!</regexMessage>
> {noformat}
> This is very misleading, as \d only matches a single digit.
> The example should be:
> {noformat}
> <regex>.*\d.*</regex>
> <regexMessage>You must have a digit in your baseDir!</regexMessage>
> {noformat}
> or possibly:
> {noformat}
> <regex>\d</regex>
> <regexMessage>Your baseDir must consist of a single digit only!</regexMessage>
> {noformat}
> The documentation should state that the regex is applied to the entire value of the property. 
> That is, it uses regex "match" rather than regex "contains", effectively the regex string is enclosed in "^" and "$" before use.
> [1] http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira