1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
1.1K views
by rich-c-2789 (17.6k points)

I have a regex like below to split text into equal parts but qie displays this warning:  line 1 col 48 - insecure '.'. 

var partsArray = 'abcdefghijklmnopqrstuvwxyz'.match(/.{1,6}/g);

The above code is valid and runs successfully.  How can I get arround this warning so that I can see if the rest of the code has valid syntax?

by js-6370 (360 points)
I just tried using the /*jshint regexp: false */ option and I get the following warning:

Bad option value.
Bad option: 'false'.

2 Answers

0 votes
 
Best answer

You can also turn off the inspection using:

/*jshint regexp: false */
var test = 'abcdefghijklmnopqrstuvwxyz'.match(/.{1,6}/g);

Also see this related question:

https://www.qvera.com/kb/index.php/62/can-i-disable-inspections-in-qie?show=62#q62

by rich-c-2789 (17.6k points)
edited by rich-c-2789
0 votes

Replace this:

var partsArray = 'abcdefghijklmnopqrstuvwxyz'.match(/.{1,6}/g);

With this:

var partsArray = 'abcdefghijklmnopqrstuvwxyz'.match(/[\w\W]{1,6}/g);

 

by rich-c-2789 (17.6k points)
...