Search with Pattern for JavaScript using Regular Expressions

How do I Implement a Custom Pattern for JavaScript using Regular expressions?

I have certain occurrences of myvar1 which may occur in the following ways in the code:

Scenario 1:    window.parent.myvar1.a();

or 

Scenario 2:    window.top.myvar1.b();

or 

Scenario 3:    myvar1.a();

or

Scenario 4:    

var myobj1 = window.top;

myobj1.myvar1.a();

 

The basic regular expression that I can put for scenario 1/2/3 is something like

[a-z0-9A-Z]{0}[\.]{0}myvar1

which runs fine with the ReSharper's Regular Expression Validator.

but the Custom Pattern window doesn't allows me to save the pattern and shows error symbol in the Save button.

Error Screenshot: CustomPatternJavaScriptRegularExpr.JPG

Kindly let me know how I can use Regular Expression for JavaScript to achieve my requirement.

0
1 comment

Hello!

 

Thank you for contacting us.

Please try adding new name placeholder to the search pattern and specify the correspondent regular expression in Name regex field.

Thank you.

0

Please sign in to leave a comment.