regexp.js (2876B)
1 /** 2 * @license Apache-2.0 3 * 4 * Copyright (c) 2018 The Stdlib Authors. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 'use strict'; 20 21 // MODULES // 22 23 var reWhitespace = require( './main.js' ); 24 25 26 // MAIN // 27 28 /** 29 * Matches a white space character. 30 * 31 * Regular expression: `/[\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/` 32 * 33 * - `[]` 34 * - match any one of the listed characters 35 * 36 * - `\u0009` 37 * - character tabulation (horizontal tab; `\t`) 38 * 39 * - `\u000A` 40 * - line feed (LF; `\n`) 41 * 42 * - `\u000B` 43 * - line tabulation (vertical tab; `\v`) 44 * 45 * - `\u000C` 46 * - form feed (`\f`) 47 * 48 * - `\u000D` 49 * - carriage return (CR; `\r`) 50 * 51 * - `\u0020` 52 * - space (most common) 53 * 54 * - `\u0085` 55 * - next line (NEL) 56 * 57 * - `\u00A0` 58 * - non-breaking space 59 * 60 * - `\u1680` 61 * - Ogham space mark 62 * 63 * - `\u2000` 64 * - en quad 65 * 66 * - `\u2001` 67 * - em quad 68 * 69 * - `\u2002` 70 * - en space 71 * 72 * - `\u2003` 73 * - em space 74 * 75 * - `\u2004` 76 * 77 * - three-per-em space (thick space) 78 * 79 * - `\u2005` 80 * - four-per-em space (mid space) 81 * 82 * - `\u2006` 83 * - six-per-em space 84 * 85 * - `\u2007` 86 * - figure space 87 * 88 * - `\u2008` 89 * - punctuation space 90 * 91 * - `\u2009` 92 * - thin space 93 * 94 * - `\u200A` 95 * - hair space 96 * 97 * - `\u2028` 98 * - line separator 99 * 100 * - `\u2029` 101 * - paragraph separator 102 * 103 * - `\u202F` 104 * - narrow no-break space 105 * 106 * - `\u205F` 107 * - medium mathematical space 108 * 109 * - `\u3000` 110 * - ideographic space 111 * 112 * - `\uFEFF` 113 * - zero width non-breaking space 114 * 115 * ## Notes 116 * 117 * - Matches the 25 characters defined as white space ("WSpace=Y","WS") characters in the Unicode 9.0 character database. 118 * - Matches one related white space character without the Unicode character property "WSpace=Y" (zero width non-breaking space which was deprecated as of Unicode 3.2). 119 * 120 * @constant 121 * @type {RegExp} 122 * @default /[\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/ 123 * @see [whitespace]{@link https://en.wikipedia.org/wiki/Whitespace_character} 124 */ 125 var REGEXP = reWhitespace(); 126 127 128 // EXPORTS // 129 130 module.exports = REGEXP;