You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Wiki, RE2 syntax states:
\s whitespace (== [\t\n\f\r ])
\w word characters (== [0-9A-Za-z_])
... but in Google Apps Scripts, this gives different results:
var char = String.fromCharCode(160); // No-Break Space
var re1 = /[\t\n\f\r 0-9A-Za-z_]/;
var re2 = /[\s\w]/;
var check = ( re1.test(char) == re2.test(char) ) ;
=> false
... also with:
var char = String.fromCharCode(249); // ù
... and many more !
The difference is not there in Google Sheets functions asRegExMatch() and Google Form validation using RegEx. So is Google Apps Script using another engine with different syntax ?
Anyway, it's confusing !
The text was updated successfully, but these errors were encountered:
In the Wiki, RE2 syntax states:
\s whitespace (== [\t\n\f\r ])
\w word characters (== [0-9A-Za-z_])
... but in Google Apps Scripts, this gives different results:
var char = String.fromCharCode(160); // No-Break Space
var re1 = /[\t\n\f\r 0-9A-Za-z_]/;
var re2 = /[\s\w]/;
var check = ( re1.test(char) == re2.test(char) ) ;
=> false
... also with:
var char = String.fromCharCode(249); // ù
... and many more !
The difference is not there in Google Sheets functions asRegExMatch() and Google Form validation using RegEx. So is Google Apps Script using another engine with different syntax ?
Anyway, it's confusing !
The text was updated successfully, but these errors were encountered: