diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-10-30 01:45:29 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-10-30 01:45:29 +0100 |
commit | 36d41648bd13176cc5bdcbdade6cc5046acab6c1 (patch) | |
tree | d0287aeff88d65bbb4b5eefde011067eb54a0c2f | |
parent | 4dde2d9838ba3ae9e39aed9007716e5e782f244c (diff) |
Simplify regex
-rw-r--r-- | grammar.js | 4 | ||||
-rw-r--r-- | src/grammar.json | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -43,8 +43,8 @@ module.exports = grammar({ ), ), - class_shorthand: $ => /\.[^\p{White_Space}]+/u, - id_shorthand: $ => /#[^\p{White_Space}]+/u, + class_shorthand: $ => /\.\P{White_Space}+/u, + id_shorthand: $ => /#\P{White_Space}+/u, attribute_name: $ => /[a-zA-Z0-9_-]+/, attribute_value: $ => /"(\\.|[^"\\])*"/, diff --git a/src/grammar.json b/src/grammar.json index 960f0dd..e3e1f0a 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -180,11 +180,11 @@ }, "class_shorthand": { "type": "PATTERN", - "value": "\\.[^\\p{White_Space}]+" + "value": "\\.\\P{White_Space}+" }, "id_shorthand": { "type": "PATTERN", - "value": "#[^\\p{White_Space}]+" + "value": "#\\P{White_Space}+" }, "attribute_name": { "type": "PATTERN", |