#75 escape_regex function does not handle backslash properly

Version 5.6
closed-fixed
Danny Haynes
5
2009-10-21
2009-10-06
Mike Lah
No

When using the escape_regex function, the string '\.' gets resolved to '\\.' instead of '\\\.', that is the backslash is not being escaped. Testing with just a backslash and just a dot separately returns the correct result, but following a backslash with a dot causes this inconsistency.

Discussion

  • Danny Haynes
    Danny Haynes
    2009-10-21

    Fixed a bug in the REGEX::EscapeRegexChars() method such that it escapes all regular expression characters regardless of whether or not the regular expression character has been escaped. For example, if you had the string '\.test*?' it would evaluate to '\\\.test\*\?' instead of '\\.test\*\?'.

     
  • Danny Haynes
    Danny Haynes
    2009-10-21

    • labels: --> Definition Evaluation
    • milestone: --> Version 5.6
    • assigned_to: nobody --> djhaynes
    • status: open --> closed-fixed