/(?:(?:^|.*;)\s*key\s*\=\s*([^;]*).*$)|^.*$/
I got this RegExp which can get the key in cookie ,but I don't know what
(?:^|.*) mean , I mean what ?: mean in javascript
/(?:(?:^|.*;)\s*key\s*\=\s*([^;]*).*$)|^.*$/
I got this RegExp which can get the key in cookie ,but I don't know what
(?:^|.*) mean , I mean what ?: mean in javascript
() would define a capturing group. (?:) will make it non-capturing.
It is called Non-Capturing Groups: (?: … )
For instance (?:Mofei|Zhu) matches Mofei or Zhu—but the name is not captured.