repl.txt (1848B)
1 2 {{alias}}( [options] ) 3 Returns a regular expression to match a white space character. 4 5 Parameters 6 ---------- 7 options: Object (optional) 8 Options. 9 10 options.flags: string (optional) 11 Regular expression flags. Default: ''. 12 13 options.capture: boolean (optional) 14 Boolean indicating whether to wrap a regular expression matching a white 15 space character with a capture group. Default: false. 16 17 Returns 18 ------- 19 re: RegExp 20 Regular expression. 21 22 Examples 23 -------- 24 > var RE = {{alias}}(); 25 > var bool = RE.test( '\n' ) 26 true 27 > bool = RE.test( ' ' ) 28 true 29 > bool = RE.test( 'a' ) 30 false 31 32 33 {{alias}}.REGEXP 34 Regular expression to match a white space character. 35 36 Matches the 25 characters defined as white space ("WSpace=Y","WS") 37 characters in the Unicode 9.0 character database. 38 39 Matches one related white space character without the Unicode character 40 property "WSpace=Y" (zero width non-breaking space which was deprecated as 41 of Unicode 3.2). 42 43 Examples 44 -------- 45 > var RE = {{alias}}.REGEXP; 46 > var bool = RE.test( '\n' ) 47 true 48 > bool = RE.test( ' ' ) 49 true 50 > bool = RE.test( 'a' ) 51 false 52 53 54 {{alias}}.REGEXP_CAPTURE 55 Regular expression to capture white space characters. 56 57 Matches the 25 characters defined as white space ("WSpace=Y","WS") 58 characters in the Unicode 9.0 character database. 59 60 Matches one related white space character without the Unicode character 61 property "WSpace=Y" (zero width non-breaking space which was deprecated as 62 of Unicode 3.2). 63 64 Examples 65 -------- 66 > var RE = {{alias}}.REGEXP_CAPTURE; 67 > var str = 'Duplicate capture'; 68 > var out = {{alias:@stdlib/string/replace}}( str, RE, '$1$1' ) 69 'Duplicate capture' 70 71 See Also 72 --------