what is the usage of '?:' in regular expression in Javascript? [duplicate]
This question already has an answer here:
Non capturing group? (?:) 5 answers
Regex: Question mark and colon 1 answer
I saw a post at the following page:
How do I trim a string in JavaScript?
in the answer of Mr.Pradeep Kumar Mishra (the second answer) I saw a
function (Fulltrim) but I can not understand the '?:' usage in regular
expression so is there anybody who can explain the following regular
expression:
/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,'').replace(/\s+/g
or explain all sections of this regexp.
Thanks
No comments:
Post a Comment