[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2434) Emiting regexps in DSLs is unwieldy in the extreme

Mark Proctor (JIRA) jira-events at lists.jboss.org
Sat Apr 3 22:50:38 EDT 2010


     [ https://jira.jboss.org/jira/browse/JBRULES-2434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor updated JBRULES-2434:
----------------------------------

       Issue Type: Feature Request  (was: Bug)
    Fix Version/s: FUTURE


> Emiting regexps in DSLs is unwieldy in the extreme
> --------------------------------------------------
>
>                 Key: JBRULES-2434
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2434
>             Project: Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: drools-compiler-DSL
>    Affects Versions: 5.0.1.FINAL
>         Environment: All
>            Reporter: Denis Robert
>            Assignee: Mark Proctor
>            Priority: Minor
>             Fix For: FUTURE
>
>
> Any regexp emitted by a DSL must be octupled in order to pass through to the DRL and actually work in the rule.
> Example: I have a simple rule (I should say: a rule which SHOULD be simple), to test for emails:
> [condition][]is not email=not matches "^[\\\\\\\\w-]+(\\\\\\\\.[\\\\\\\\w-]+)*@([a-z0-9-]+(\\\\\\\\.[a-z0-9-]+)*?\\\\\\\\.[a-z]{2,6}|(\\\\\\\\d{1,3}\\\\\\\\.){3}\\\\\\\\d{1,3})(:\\\\\\\\d{4})?$"
> As you can see, each backslash is there 8 times. By then time it appears in the resulting DSL, they are doubled (which contrary to docs must be the case, otherwise the regexp does not behave correctly).
> Regular expressions should be treated differently throughout Drools. Maybe by using raw strings as in Perl or C#? It's really annoying...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list