Bug 724771 (BRMS-609) - Could not parse escaped characters
Summary: Could not parse escaped characters
Keywords:
Status: CLOSED WONTFIX
Alias: BRMS-609
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: unspecified
Version: BRMS 5.2.0-Dev1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: BRMS 5.2.0.GA
Assignee: Edson Tirelli
QA Contact: Tomas Schlosser
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-24 07:15 UTC by Tomas Schlosser
Modified: 2011-09-30 02:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In previous versions of BRMS it was possible to use single escape characters in strings, this behavior was maintained in previous 5.x versions for backwards compatibility, however, the use of single escape characters for strings has been deprecated and it is now necessary to use double escape characters in BRMS 5.2.
Clone Of:
Environment:
Last Closed: 2011-07-29 13:52:34 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-609 0 None Closed Parsing escaped characters 2011-10-05 03:07:23 UTC

Description Tomas Schlosser 2011-06-24 07:15:22 UTC
securitylevel_name: Public

See JBRULES-2992

Comment 1 Tomas Schlosser 2011-06-24 07:16:14 UTC
Link: Added: This issue depends JBRULES-2992


Comment 2 Edson Tirelli 2011-07-19 13:13:59 UTC
The use of single escapes for regex was deprecated in the 5.0 community version and maintained just for backward compatibility with 4.x during 2 years. With the parser rewrite in the 5.2 community version, we thought it was time to remove that and handle escapes the 5.x way (i.e., like in java) with double escapes. 

I am closing this ticket, but if there is a reason to still support single escapes for regex, feel free to reopen this ticket and let us know and we might consider reimplementing the processStringScapes. 


Comment 3 Edson Tirelli 2011-07-19 13:13:59 UTC
Release Notes Docs Status: Added: Not Yet Documented


Comment 4 Tomas Schlosser 2011-07-22 06:12:49 UTC
BRMS Reference Guide states
"In contrast to Java, escapes are not needed within regular expressions written as string literals."
Only other references to this are in release notes for BRMS 5.0.1 and 5.1.0 stating that ProcessStringEscapesOption was added.
There is no warning about deprecation. Therefore I'm reopening the bug and would like PM to decide about it on next triage meeting.

Comment 5 Edson Tirelli 2011-07-22 14:29:51 UTC
Ok, let us know. It is possible that the documentation is not accurate, but the default option for 5.x was to process string escapes like java, obviously requiring double \\ when the \ is to be used as a literal.

It is important to understand that the effect of disabling escape processing affects all strings in all rules, not only regexps. So if one disables it to work like it was in Drools 4, it makes impossible to use special characters in strings everywhere. For instance:

Header( content == "foo\n" )

The above is a string with 5 characters ('f' 'o' 'o' '\' 'n') and not what was probably the intent 3 characters + line feed ('f' 'o' 'o' <linefeed>). 

This limitation was the reason we moved away from it when we released Drools 5.0.

Comment 6 Anne-Louise Tangring 2011-07-29 13:52:34 UTC
We will need to release note this, as it was never meant to work in 5.x.

Comment 7 Anne-Louise Tangring 2011-07-29 13:52:34 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Need release notes.

Comment 8 lcarlon 2011-08-24 00:25:14 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,3 @@
-Need release notes.+https://bugzilla.redhat.com/show_bug.cgi?id=724771
+
+The use of single escape characters for strings has been deprecated. In previous versions of BRMS it was possible to use single escape characters in strings, this behavior was maintained in previous 5.x versions for backwards compatibility, however it is necessary to use double escape characters in BRMS 5.2 as this is no longer supported.

Comment 9 lcarlon 2011-09-14 04:31:28 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,3 +1 @@
-https://bugzilla.redhat.com/show_bug.cgi?id=724771
-
 The use of single escape characters for strings has been deprecated. In previous versions of BRMS it was possible to use single escape characters in strings, this behavior was maintained in previous 5.x versions for backwards compatibility, however it is necessary to use double escape characters in BRMS 5.2 as this is no longer supported.

Comment 10 lcarlon 2011-09-30 02:59:00 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-The use of single escape characters for strings has been deprecated. In previous versions of BRMS it was possible to use single escape characters in strings, this behavior was maintained in previous 5.x versions for backwards compatibility, however it is necessary to use double escape characters in BRMS 5.2 as this is no longer supported.+In previous versions of BRMS it was possible to use single escape characters in strings, this behavior was maintained in previous 5.x versions for backwards compatibility, however, the use of single escape characters for strings has been deprecated and it is now necessary to use double escape characters in BRMS 5.2.


Note You need to log in before you can comment on or make changes to this bug.