-
-
Notifications
You must be signed in to change notification settings - Fork 133
Description
This seems a little convoluted.
-
I'm really not sure exactly what we are testing here. It seems like you are looking for
insert.match(/[\u0009...]$/)? Is it intended to match having a single whitespace character on the end of the text? If so, then the function name is not very clear. If not, then AFAICT the function is not correct. -
imodifier should not be necessary on the regex -- there's no case to be insensitive about 🤣. -
Can we use a character class for the regex match rather than a set of characters? (e.g.
insert.match(/[\p{Z}\r\n]$/u). Note Chrome 50+ though (so we could have the shorter regex as a comment if we can't use it for back-compat reasons). -
Finally, can we have a javadoc comment rather than the in-function comment?
Originally posted by @mcdurdin in #7205 (comment)