-
-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Regex character class subtraction is annoying.
New-Regex should include something to abstract it.
Describe the solution you'd like
New-Regex should add -NotCharacterClass and -NotLiteralCharacter.
Without additional parameters, these should act like -CharacterClass and -LiteralCharacter, except that the selection set should be prefixed with ^ (to indicate that it is not those characters)
When provided with -CharacterClass or -LiteralCharacter, these should create a character class subtraction.
# Match anything but punctuation
New-RegEx -NotCharacterClass Punctuation
# Match any punctuation except open/close/quote/endquote, and comma.
New-RegEx -CharacterClass Punctuation -NotCharacterClass PunctuationOpen, PunctuationClose, PunctuationInitialQuote, PunctuationFinalQuote -NotLiteralCharacter ',' Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request