Highlighted
Trusted Contributor.
Trusted Contributor.
1241 views

Regular Expression Issue

Jump to solution

Hi There,
I encountered "Error -35055 Invalid regular expression" in a web protocol script. However I tested my regular expression in online regex tester website and I do get pass (see 2nd snapshot).  In Vugen, I use the same RE but get error message (see 1st snapshot). I don't know what is the root cause of this issue. Is there any person with the similar experience before can provide suggestion?

The RE expression is as below: 

web_reg_save_param_regexp("ParamName=C_afmsdecode_2","RegExp=<script id=\"loadTandCModel\" type=\"text\/javascript\">\s+jQuery\(document\)\.ready\(function\(\) \{\s+\(function \(\) \{\s+afmsdecode\(\"(.+)\"","Ordinal=1",LAST);

Vugen Error.JPG
Regular Expression Online Test.JPG

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

When you go from a valid regex to a C-string, you have to escape two characters in your regexp: " and \ so when your regexp is

Hallo\s"world\."

Your argument becomes:

"RegExp=Hallo\\s\"world\\.\""

 

Signature:
Reward community members who take time to respond and help.

View solution in original post

2 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

When you go from a valid regex to a C-string, you have to escape two characters in your regexp: " and \ so when your regexp is

Hallo\s"world\."

Your argument becomes:

"RegExp=Hallo\\s\"world\\.\""

 

Signature:
Reward community members who take time to respond and help.

View solution in original post

Highlighted
Trusted Contributor.
Trusted Contributor.

Thank you, JHF Remmelzwaal! My issue is solved with your reply.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.