Closed
Bug 1359860
Opened 8 years ago
Closed 5 years ago
Make /W special character regex more clear
Categories
(Developer Documentation Graveyard :: JavaScript, defect, P5)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: james-barrett, Unassigned)
References
()
Details
:: Developer Documentation Request
Request Type: Correction
Gecko Version: unspecified
Technical Contact:
:: Details
First time contributor, so correct me if I am wrong!
I think that the '\W' special character should note that this does NOT include the underscore.
For example:
var str = "_james"
if (str[0].search(/\W/) !== -1) - I expected this to return true however it didn't. I needed to add '|| str[i] === "_"' to the conditional.
Could this be mentioned in the docs for clarity?
Thanks.
Comment 1•5 years ago
|
||
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•