Announcement

Collapse

NextGen (Mirth) Connect 3.10.0 Released!

NextGen (Mirth) Connect 3.10.0 is now available as an appliance update and on our GitHub page. This release includes better SQL Server database support, security improvements through fixes and library updates, and improvements for the Advanced Clustering plugin with a focus on improving performance of many of the tasks that are carried out on a frequent interval. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

1.5 Regular Expressions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 1.5 Regular Expressions

    Hi,

    Just wondering if someone give an example of how to use the regular expression form in the transformer. I need to replace a ' (single quote) with " " (null).

    What I have
    Regular expression: '
    ReplaceWith: ""

    Any help is appreciated.

  • #2
    Re:1.5 Regular Expressions

    You might want to do this in the preprocessor script if you are trying to remove all 's from your message. I think it is something like:

    return message.replace(/\\u002c/g, "");

    If that doesn't work, Chris would know how to answer this better than me (he loves regular expressions).

    Post edited by: brendanh, at: 05/30/2007 15:52
    Brendan Haverlock | Mirth Software Engineer | Mirth Corporation

    Comment


    • #3
      Re:1.5 Regular Expressions

      Regular Expression:

      /'/g

      Replace with:

      ""
      Chris Lang

      Comment


      • #4
        Re:1.5 Regular Expressions

        That won't compile buddy.
        Brendan Haverlock | Mirth Software Engineer | Mirth Corporation

        Comment


        • #5
          Re:1.5 Regular Expressions

          Try:
          Code:
          /\\\\'/g
          Post edited by: chrisl, at: 05/31/2007 02:21
          Chris Lang

          Comment


          • #6
            Re:1.5 Regular Expressions

            I couldn't get that to work, it doesn't like
            Code:
            /\\\\'/g
            ,

            Code:
            /\\'/g
            is accepted but does not remove the '.

            I used the following in the preprocessing script and it worked:

            Code:
            var reg = new RegExp();
            reg.compile("'", "g"«»);
            return message.replace(reg,(""«»));
            Post edited by: mulaa, at: 05/31/2007 14:03

            Comment

            Working...
            X