web stats
Mirth Community - View Single Post - Invalid quantifier ? when using Lookbehind regex
View Single Post
  #1  
Old 02-19-2016, 10:26 AM
batejo batejo is offline
What's HL7?
 
Join Date: Feb 2016
Posts: 3
batejo is on a distinguished road
Default Invalid quantifier ? when using Lookbehind regex

Hi,

I'm trying to use in a transformer a regular expression to match some data but I'm getting this error.

Here is an example of what I am doing.

The data:

Code:
<value name="VALUE" type="Numeric" unit="Ohm">
     3000
     <escape type="GREATER_THAN_MAX" />
</value>
What I want to match is what is inside the escape.type attribute.

So i execute this javascript in my transformer:

Code:
var matches = node.toString().match(/(?<=<escape type=")(.+)(?=" \/>)/);
When deploying my channel I get the error:

SyntaxError: Invalid quantifier ?

How can I use my regular expression without getting the error?

Thanks
Reply With Quote