cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Regex in Thingworx

drichter
14-Alexandrite

Regex in Thingworx

Hi,

 

I have an regex (tested on regex101.com with javascript selected) and I get an exception

 

[message: SyntaxError: invalid flag after regular expression]

 

The regex:

/<mabasedata\s*(comment=\"([a-z0-9]*)\")+>/gi;

Text to parse

<MaBaseData Comment="abc">

Maybe this is a problem with the server-side javascript?

2 REPLIES 2
supandey
19-Tanzanite
(To:drichter)

Hi @drichter wondering if this also throws error for you?

 

\/<mabasedata\s*(comment=\"([a-z0-9]*)\")+>\/gi;
drichter
14-Alexandrite
(To:supandey)

In js you defined regex via:

var regex = /bla/OPTIONS;

To escape the / does not work.

Top Tags