LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Special Characters

    Employee
    Posted 07-27-2010 08:59

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Melissa

    How you identify a special character? Take for example I would like to split the data based on parentheses.

    FIELDNAME.regexIsMatch("(")

    The node errors because it is searching for the close parentheses.

    I tried using the ASCII code: FIELDNAME.regexIsMatch("/050")

    The node doesn't error but it is not identifying the parentheses.


  • 2.  RE: Special Characters

    Employee
    Posted 07-27-2010 12:37

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Melissa

    I'm also seeing a problem with $.

    I can replace "(", ")", and "$". I'm starting to notice I cannot use those three symbols with regexIsMatch.


  • 3.  RE: Special Characters

    Employee
    Posted 07-27-2010 15:45

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: MartyWalsh

    The problem here is that (, ) and $ are all special characters as defined by a language called Regular Expressions. See http://en.wikipedia.org/wiki/Regular_expression for more information.


    If you have ( as a delimiter, and you wish to identify a string matching it, the syntax is:
    result = regexIsMatch("StrngtoSearch" , "//(" )
    ie, "//" escapes the special character and allows it to be treated as a normal character.

    Attached is a graph that shows a very basic example for using special characters in regular Expression matching.

    Cheers
    Attachments:
    veryBasicRegexGraph.brg