Details
-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
*Location*: http://developer.couchbase.com/documentation/server/4.0/xdcr/xdcr-reg-expressions.html
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
*Referrer*: http://developer.couchbase.com/documentation/server/4.0/xdcr/xdcr-filtering-setup.html
*Screen Resolution*: 1920 x 1080
*Location*: http://developer.couchbase.com/documentation/server/4.0/xdcr/xdcr-reg-expressions.html *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36 *Referrer*: http://developer.couchbase.com/documentation/server/4.0/xdcr/xdcr-filtering-setup.html *Screen Resolution*: 1920 x 1080
Description
http://developer.couchbase.com/documentation/server/4.0/xdcr/xdcr-reg-expressions.html
The page states:
^ This is the "not" character, therefore [^0-9] matches against any character that is not a digit.
that isn't entirely true and could be confusing, we use the javascript regex model, looking at the mozilla regex docs a hat character "^" has 2 meanings and the "not" attribute is the least common attribute.
https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions
states:
Matches beginning of input. If the multiline flag is set to true, also matches immediately after a line break character.
For example, /^A/ does not match the 'A' in "an A", but does match the 'A' in "An E".
The '^' has a different meaning when it appears as the first character in a character set pattern. See complemented character sets for details and an example.