diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c58c73..563baec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -## 0.7.3: +## 0.7.4: +* ANSI Improvements: + * Regenerated ? (Fixes #150) + * Added ? (Fixes #151) +--- + +## 0.7.3: * ANSI Improvements: * Fixed ? (Fixes #143) * ? now supports bright ranges (Fixes #145) diff --git a/Irregular.psd1 b/Irregular.psd1 index 2b0f702..dccb344 100644 --- a/Irregular.psd1 +++ b/Irregular.psd1 @@ -1,5 +1,5 @@ @{ - ModuleVersion = '0.7.3' + ModuleVersion = '0.7.4' RootModule = 'Irregular.psm1' Description = 'Regular Expressions made Strangely Simple' FormatsToProcess = 'Irregular.format.ps1xml' @@ -14,6 +14,12 @@ LicenseURI = 'https://github.com/StartAutomating/Irregular/blob/master/LICENSE' IconURI = 'https://github.com/StartAutomating/Irregular/blob/master/Assets/Irregular_600_Square.png' ReleaseNotes = @' +## 0.7.4: +* ANSI Improvements: + * Regenerated ? (Fixes #150) + * Added ? (Fixes #151) +--- + ## 0.7.3: * ANSI Improvements: * Fixed ? (Fixes #143) diff --git a/README.md b/README.md index e7feb5b..e436473 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

Regular Expressions made Strangely Simple

A PowerShell module that helps you understand, use, and build Regular Expressions.

-v 0.7.3 +v 0.7.4

@@ -32,7 +32,7 @@ Once you understand some basics of that syntax, regular expressions become a lot 3. A Regex can have comments! ( # Like this in .NET ( or like (?#this comment) in ECMAScript ) ). 4. You don't have to do it all in one expression! -Irregular comes with 130 useful [named expressions](SavedPatterns.md), and lets you create more. +Irregular comes with 131 useful [named expressions](SavedPatterns.md), and lets you create more. To see the expressions that ship with Irregular, run: diff --git a/RegEx/ANSI/Color.regex.txt b/RegEx/ANSI/Color.regex.txt index cc8dc18..0476ccb 100644 --- a/RegEx/ANSI/Color.regex.txt +++ b/RegEx/ANSI/Color.regex.txt @@ -1,41 +1,51 @@ # Matches an ANSI color (?> (? -(?-i)\e # An Escape -\[ # Followed by a bracket -38;2;(?(?(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Red is the first 0-255 value -;(?(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Green is the second 0-255 value -;(?(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Blue is the third 0-255 value +(?-i)\e # An Escape +\[ # Followed by a bracket +(?> + (?38) | + (?48) | + (?58));2;(?(?(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Red is the first 0-255 value +;(?(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Green is the second 0-255 value +;(?(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Blue is the third 0-255 value m) ) | (? -(?-i)\e # An Escape -\[ # Followed by a bracket -38;5;(?(?> - (?[0-7]) # 0 -7 are standard colors +(?-i)\e # An Escape +\[ # Followed by a bracket +(?> + (?38) | + (?48) | + (?58));5;(?(?> + (?[0-7]) # 0 -7 are standard colors m | - (?(?>[8-9]|1[0-5])) # 8-15 are bright colors + (?(?>[8-9]|1[0-5])) # 8-15 are bright colors m | - (?(?>[0-2][0-3][0-1]|[0-1]\d\d|\d{1,2})) # 16-231 are cubed colors + (?(?>[0-2][0-3][0-1]|[0-1]\d\d|\d{1,2})) # 16-231 are cubed colors m | - (?(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # 232-255 are grayscales + (?(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # 232-255 are grayscales m)) ) | (? -\e # An Escape -\[ # Followed by a bracket -(?(?1)?\;?(?3[0-7])?(?(ForegroundColor)(m)|((?4[0-7])m))) +\e # An Escape +\[ # Followed by a bracket +(?(?> + (?1)?\;{0,1}(?3) | + (?(?9)) | + (?1)?\;{0,1}(?4) | + (?(?10)))(?[0-7])m) ) | (? -(?-i)\e # An Escape -\[ # Followed by a bracket +(?-i)\e # An Escape +\[ # Followed by a bracket (?(?> - (?39) # 39 Represents the default foreground color + (?39) # 39 Represents the default foreground color m | - (?49) # 49 Represents the default background color + (?49) # 49 Represents the default background color m)) ) ) diff --git a/RegEx/ANSI/Cursor.regex.source.ps1 b/RegEx/ANSI/Cursor.regex.source.ps1 new file mode 100644 index 0000000..607b19a --- /dev/null +++ b/RegEx/ANSI/Cursor.regex.source.ps1 @@ -0,0 +1,64 @@ +$myName = ($MyInvocation.MyCommand.ScriptBlock.File | Split-Path -Leaf) -replace '\.source', '' -replace '\.ps1', '.txt' +$myRoot = $MyInvocation.MyCommand.ScriptBlock.File | Split-Path + +New-RegEx -Description "Matches an ANSI cursor control" | + New-RegEx -CharacterClass Escape | + New-RegEx -LiteralCharacter '[' | + New-RegEx -Atomic -Or @( + New-RegEx -Pattern '6n' -Name 'DeviceStatusReport' -Comment '6n will request the cursor position' + New-RegEx -Pattern ( + New-RegEx -Name Row -Pattern '\d+' | + New-RegEx -LiteralCharacter ';' | + New-RegEx -Name Column -Pattern '\d+' | + New-RegEx -Pattern 'R' + ) -Comment "A Device Status Report will return CursorPosition in the form ; R" -Name CursorPosition + New-RegEx -Name CursorUp -Comment "Cursor Up is a digit followed by A" -Pattern ( + New-RegEx -Name RowCount -Pattern '\d+' | + New-RegEx -Pattern 'A' + ) + New-RegEx -Name CursorDown -Comment "Cursor Down is a digit followed by B" -Pattern ( + New-RegEx -Name RowCount -Pattern '\d+' | + New-RegEx -Pattern 'B' + ) + New-RegEx -Name CursorForward -Comment "Cursor Forward is a digit followed by C" -Pattern ( + New-RegEx -Name ColumnCount -Pattern '\d+' | + New-RegEx -Pattern 'C' + ) + New-RegEx -Name CursorBack -Comment "Cursor Back is a digit followed by D" -Pattern ( + New-RegEx -Name ColumnCount -Pattern '\d+' | + New-RegEx -Pattern 'D' + ) + New-RegEx -Name CursorNextLine -Comment "Cursor Next Line is a digit followed by E" -Pattern ( + New-RegEx -Name LineCount -Pattern '\d+' | + New-RegEx -Pattern 'E' + ) + New-RegEx -Name CursorNextLine -Comment "Cursor Next Line is a digit followed by F" -Pattern ( + New-RegEx -Name LineCount -Pattern '\d+' | + New-RegEx -Pattern 'F' + ) + New-RegEx -Name CursorAbsolute -Comment "Cursor Absolute Position is a digit followed by G" -Pattern ( + New-RegEx -Name AbsolutePosition -Pattern '\d+' | + New-RegEx -Pattern 'G' + ) + New-RegEx -Name CursorPosition -Comment "Cursor Positions are two optional digits, separated by semicolon, ending with H" -Pattern ( + New-RegEx -Name Row -Pattern '\d{0,}' | + New-RegEx -LiteralCharacter ';' | + New-RegEx -Name Column -Pattern '\d{0,}' | + New-RegEx -LiteralCharacter 'H' + ) + New-RegEx -Name ScrollUp -Comment "Scroll Up is a digit followed by S" -Pattern ( + New-RegEx -Name PageCount -Pattern '\d+' | + New-RegEx -Pattern 'S' + ) + New-RegEx -Name ScrollDown -Comment "Scroll Down is a digit followed by T" -Pattern ( + New-RegEx -Name PageCount -Pattern '\d+' | + New-RegEx -Pattern 'T' + ) + New-RegEx -Name CursorHide -Comment 'Cursors can be hidden with 25h' ( + New-RegEx -Pattern '25h' + ) + New-RegEx -Name CursorShow -Comment 'Cursors can be hidden with 25l' ( + New-RegEx -Pattern '25l' + ) + ) | + Set-Content -Path (Join-Path $myRoot $myName) -PassThru diff --git a/RegEx/ANSI/Cursor.regex.txt b/RegEx/ANSI/Cursor.regex.txt new file mode 100644 index 0000000..8292171 --- /dev/null +++ b/RegEx/ANSI/Cursor.regex.txt @@ -0,0 +1,30 @@ +# Matches an ANSI cursor control +\e\[(?> + (?6n) # 6n will request the cursor position + | + (?(?\d+)\;(?\d+)R) # A Device Status Report will return CursorPosition in the form ; R + | + (?(?\d+)A) # Cursor Up is a digit followed by A + | + (?(?\d+)B) # Cursor Down is a digit followed by B + | + (?(?\d+)C) # Cursor Forward is a digit followed by C + | + (?(?\d+)D) # Cursor Back is a digit followed by D + | + (?(?\d+)E) # Cursor Next Line is a digit followed by E + | + (?(?\d+)F) # Cursor Next Line is a digit followed by F + | + (?(?\d+)G) # Cursor Absolute Position is a digit followed by G + | + (?(?\d{0,})\;(?\d{0,})H) # Cursor Positions are two optional digits, separated by semicolon, ending with H + | + (?(?\d+)S) # Scroll Up is a digit followed by S + | + (?(?\d+)T) # Scroll Down is a digit followed by T + | + (?25h) # Cursors can be hidden with 25h + | + (?25l) # Cursors can be hidden with 25l +) diff --git a/RegEx/ANSI/README.md b/RegEx/ANSI/README.md index e16cfe3..2960627 100644 --- a/RegEx/ANSI/README.md +++ b/RegEx/ANSI/README.md @@ -12,6 +12,7 @@ Note: Using these regular expressions in the terminal may result in awkward out |[?](Bold.regex.txt) |Matches an ANSI Bold Start or End |[source](Bold.regex.source.ps1) | |[?](Code.regex.txt) |Matches an ANSI escape code |[source](Code.regex.source.ps1) | |[?](Color.regex.txt) |Matches an ANSI color |[source](Color.regex.source.ps1) | +|[?](Cursor.regex.txt) |Matches an ANSI cursor control |[source](Cursor.regex.source.ps1) | |[?](DefaultColor.regex.txt) |Matches an ANSI 24-bit color |[source](DefaultColor.regex.source.ps1) | |[?](Faint.regex.txt) |Matches an ANSI Faint (aka dim) Start or End |[source](Faint.regex.source.ps1) | |[?](Hide.regex.txt) |Matches ANSI Hide (aka conceal) Start or End |[source](Hide.regex.source.ps1) | diff --git a/SavedPatterns.md b/SavedPatterns.md index e207cf1..47cce9a 100644 --- a/SavedPatterns.md +++ b/SavedPatterns.md @@ -1,5 +1,5 @@ ### Irregular Patterns -Irregular includes 130 regular expressions +Irregular includes 131 regular expressions |Name|Description|IsGenerator| |:---|:----------|:----------| |[ANSI_24BitColor](/RegEx/ANSI/24BitColor.regex.txt)|Matches an ANSI 24-bit color|False| @@ -9,6 +9,7 @@ Irregular includes 130 regular expressions |[ANSI_Bold](/RegEx/ANSI/Bold.regex.txt)|Matches an ANSI Bold Start or End|False| |[ANSI_Code](/RegEx/ANSI/Code.regex.txt)|Matches an ANSI escape code|False| |[ANSI_Color](/RegEx/ANSI/Color.regex.txt)|Matches an ANSI color|False| +|[ANSI_Cursor](/RegEx/ANSI/Cursor.regex.txt)|Matches an ANSI cursor control|False| |[ANSI_DefaultColor](/RegEx/ANSI/DefaultColor.regex.txt)|Matches an ANSI 24-bit color|False| |[ANSI_Faint](/RegEx/ANSI/Faint.regex.txt)|Matches an ANSI Faint (aka dim) Start or End|False| |[ANSI_Hide](/RegEx/ANSI/Hide.regex.txt)|Matches ANSI Hide (aka conceal) Start or End|False| diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 89e5723..846e491 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.7.4: +* ANSI Improvements: + * Regenerated ? (Fixes #150) + * Added ? (Fixes #151) +--- + ## 0.7.3: * ANSI Improvements: * Fixed ? (Fixes #143) diff --git a/docs/Export-RegEx.md b/docs/Export-RegEx.md index a1ad52b..f886315 100644 --- a/docs/Export-RegEx.md +++ b/docs/Export-RegEx.md @@ -135,7 +135,7 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co --- ### Syntax ```PowerShell -Export-RegEx [[-Name] <String[]>] [[-Path] <String>] [[-As] <String>] [[-Noun] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +Export-RegEx [[-Name] ] [[-Path] ] [[-As] ] [[-Noun] ] [-WhatIf] [-Confirm] [] ``` --- ### Notes diff --git a/docs/Get-RegEx.md b/docs/Get-RegEx.md index 30bd2af..f127cfd 100644 --- a/docs/Get-RegEx.md +++ b/docs/Get-RegEx.md @@ -36,12 +36,12 @@ Get-RegEx -Name NextWord @(Get-RegEx | # Gets all saved Regular Expressions as a Markdown table Sort-Object Name | ForEach-Object -Begin { - '|Name|Description|IsGenerator|' - '|:---|:----------|:----------|' + '|Name|Description|IsGenerator|' + '|:---|:----------|:----------|' } -Process { - $desc = $_.Description -replace '[\[\{\(]', '\$0' - $desc= if ($desc) {$desc | ?<NewLine> -Replace '<br/>'} else { ''} - "|$($_.Name)|$desc|$($_.IsGenerator)|" + $desc = $_.Description -replace '[\[\{\(]', '\$0' + $desc= if ($desc) {$desc | ? -Replace '
'} else { ''} + "|$($_.Name)|$desc|$($_.IsGenerator)|" }) -join [Environment]::NewLine ``` @@ -152,13 +152,15 @@ It prevents name conflicts with Irregular. --- ### Outputs -System.Management.Automation.PSObject +* [Management.Automation.PSObject](https://learn.microsoft.com/en-us/dotnet/api/System.Management.Automation.PSObject) + + --- ### Syntax ```PowerShell -Get-RegEx [[-Name] <String[]>] [[-FilePath] <String[]>] [[-FromModule] <String[]>] [[-As] <String>] [[-Noun] <String>] [<CommonParameters>] +Get-RegEx [[-Name] ] [[-FilePath] ] [[-FromModule] ] [[-As] ] [[-Noun] ] [] ``` --- diff --git a/docs/Import-RegEx.md b/docs/Import-RegEx.md index 6c99386..bd4984f 100644 --- a/docs/Import-RegEx.md +++ b/docs/Import-RegEx.md @@ -125,16 +125,18 @@ If set, will output the imported regular expressions. --- ### Outputs -System.Nullable +* [Nullable](https://learn.microsoft.com/en-us/dotnet/api/System.Nullable) + + +* [Management.Automation.PSObject](https://learn.microsoft.com/en-us/dotnet/api/System.Management.Automation.PSObject) -System.Management.Automation.PSObject --- ### Syntax ```PowerShell -Import-RegEx [[-FilePath] <String[]>] [[-FromModule] <String[]>] [[-Pattern] <String[]>] [[-Name] <String[]>] [-PassThru] [<CommonParameters>] +Import-RegEx [[-FilePath] ] [[-FromModule] ] [[-Pattern] ] [[-Name] ] [-PassThru] [] ``` --- diff --git a/docs/New-RegEx.md b/docs/New-RegEx.md index b7c064f..71ddd0f 100644 --- a/docs/New-RegEx.md +++ b/docs/New-RegEx.md @@ -29,12 +29,12 @@ New-RegEx -CharacterClass Digit -Repeat -Name Digits #### EXAMPLE 3 ```PowerShell -# A regular expression for a quoted string (with \" and `" as valid escape sequences) -New-RegEx -Pattern '"' | +# A regular expression for a quoted string (with \" and `" as valid escape sequences) +New-RegEx -Pattern '"' | New-RegEx -CharacterClass Any -Repeat -Lazy -Before ( - New-RegEx -Pattern '"' -NotAfter '\\|`' + New-RegEx -Pattern '"' -NotAfter '\\|`' ) | - New-RegEx -Pattern '"' + New-RegEx -Pattern '"' ``` #### EXAMPLE 4 @@ -59,9 +59,9 @@ New-RegEx -Description "Matches an Email Address" | #### EXAMPLE 5 ```PowerShell # Writes a pattern for multiline comments -New-RegEx -Pattern \<\# | - New-RegEx -Name Block -Until \#\> | - New-RegEx -Pattern \#\> +New-RegEx -Pattern \<\# | + New-RegEx -Name Block -Until \#\> | + New-RegEx -Pattern \#\> ``` --- @@ -1137,16 +1137,18 @@ A list of arguments. These are only valid if the regex is using a Generator scr --- ### Outputs -System.Text.RegularExpressions.Regex +* [Text.RegularExpressions.Regex](https://learn.microsoft.com/en-us/dotnet/api/System.Text.RegularExpressions.Regex) + + +* [Management.Automation.PSObject](https://learn.microsoft.com/en-us/dotnet/api/System.Management.Automation.PSObject) -System.Management.Automation.PSObject --- ### Syntax ```PowerShell -New-RegEx [[-Pattern] <String[]>] [-Name <String>] [-CharacterClass <String[]>] [-LiteralCharacter <String[]>] [-UnicodeCharacter <Int32[]>] [-ExcludeCharacterClass <String[]>] [-ExcludeLiteralCharacter <String[]>] [-ExcludeUnicodeCharacter <Int32[]>] [-DigitMax <UInt32>] [-Backreference <String>] [-NotAfter <String>] [-NotBefore <String>] [-After <String>] [-Before <String>] [-Repeat] [-Greedy] [-Lazy] [-Min <Int32>] [-Max <Int32>] [-If <String>] [-Then <String[]>] [-Else <String[]>] [-Until <String[]>] [-Comment <String>] [-Description <String>] [-Not] [-Or] [-StartAnchor <String>] [-EndAnchor <String>] [-Modifier <String[]>] [-Optional] [-Atomic] [-NoCapture] [-PrePattern <String[]>] [-TimeOut <TimeSpan>] [-Between <String[]>] [-EscapeSequence <String>] [-Denormalized] [-Parameter <IDictionary>] [-ArgumentList <PSObject[]>] [<CommonParameters>] +New-RegEx [[-Pattern] ] [-Name ] [-CharacterClass ] [-LiteralCharacter ] [-UnicodeCharacter ] [-ExcludeCharacterClass ] [-ExcludeLiteralCharacter ] [-ExcludeUnicodeCharacter ] [-DigitMax ] [-Backreference ] [-NotAfter ] [-NotBefore ] [-After ] [-Before ] [-Repeat] [-Greedy] [-Lazy] [-Min ] [-Max ] [-If ] [-Then ] [-Else ] [-Until ] [-Comment ] [-Description ] [-Not] [-Or] [-StartAnchor ] [-EndAnchor ] [-Modifier ] [-Optional] [-Atomic] [-NoCapture] [-PrePattern ] [-TimeOut ] [-Between ] [-EscapeSequence ] [-Denormalized] [-Parameter ] [-ArgumentList ] [] ``` --- diff --git a/docs/README.md b/docs/README.md index 254ff9e..4c06b4d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,7 @@

Regular Expressions made Strangely Simple

A PowerShell module that helps you understand, use, and build Regular Expressions.

-v 0.7.3 +v 0.7.4

@@ -32,7 +32,7 @@ Once you understand some basics of that syntax, regular expressions become a lot 3. A Regex can have comments! ( # Like this in .NET ( or like (?#this comment) in ECMAScript ) ). 4. You don't have to do it all in one expression! -Irregular comes with 130 useful [named expressions](SavedPatterns.md), and lets you create more. +Irregular comes with 131 useful [named expressions](SavedPatterns.md), and lets you create more. To see the expressions that ship with Irregular, run: diff --git a/docs/Remove-RegEx.md b/docs/Remove-RegEx.md index 425f730..ac290a6 100644 --- a/docs/Remove-RegEx.md +++ b/docs/Remove-RegEx.md @@ -60,13 +60,15 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co --- ### Outputs -System.Nullable +* [Nullable](https://learn.microsoft.com/en-us/dotnet/api/System.Nullable) + + --- ### Syntax ```PowerShell -Remove-RegEx [-Name] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>] +Remove-RegEx [-Name] [-WhatIf] [-Confirm] [] ``` --- diff --git a/docs/SavedPatterns.md b/docs/SavedPatterns.md index b8098b6..d3fa539 100644 --- a/docs/SavedPatterns.md +++ b/docs/SavedPatterns.md @@ -1,5 +1,5 @@ ### Irregular Patterns -Irregular includes 130 regular expressions +Irregular includes 131 regular expressions |Name|Description|IsGenerator| |:---|:----------|:----------| |[ANSI_24BitColor](/RegEx/ANSI/24BitColor.regex.txt)|Matches an ANSI 24-bit color|False| @@ -9,6 +9,7 @@ Irregular includes 130 regular expressions |[ANSI_Bold](/RegEx/ANSI/Bold.regex.txt)|Matches an ANSI Bold Start or End|False| |[ANSI_Code](/RegEx/ANSI/Code.regex.txt)|Matches an ANSI escape code|False| |[ANSI_Color](/RegEx/ANSI/Color.regex.txt)|Matches an ANSI color|False| +|[ANSI_Cursor](/RegEx/ANSI/Cursor.regex.txt)|Matches an ANSI cursor control|False| |[ANSI_DefaultColor](/RegEx/ANSI/DefaultColor.regex.txt)|Matches an ANSI 24-bit color|False| |[ANSI_Faint](/RegEx/ANSI/Faint.regex.txt)|Matches an ANSI Faint (aka dim) Start or End|False| |[ANSI_Hide](/RegEx/ANSI/Hide.regex.txt)|Matches ANSI Hide (aka conceal) Start or End|False| diff --git a/docs/Set-RegEx.md b/docs/Set-RegEx.md index 295cfb3..9a7a3bf 100644 --- a/docs/Set-RegEx.md +++ b/docs/Set-RegEx.md @@ -163,13 +163,15 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co --- ### Outputs -System.Nullable +* [Nullable](https://learn.microsoft.com/en-us/dotnet/api/System.Nullable) + + --- ### Syntax ```PowerShell -Set-RegEx [-Pattern] <String> [[-Name] <String>] [-Description <String>] [-Path <String>] [-Temporary] [-TimeOut <TimeSpan>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>] +Set-RegEx [-Pattern] [[-Name] ] [-Description ] [-Path ] [-Temporary] [-TimeOut ] [-PassThru] [-WhatIf] [-Confirm] [] ``` --- diff --git a/docs/Show-RegEx.md b/docs/Show-RegEx.md index 9956764..2a3a45b 100644 --- a/docs/Show-RegEx.md +++ b/docs/Show-RegEx.md @@ -186,13 +186,15 @@ The match timeout. By default, one second. --- ### Outputs -Irregular.RegEx.Output +* Irregular.RegEx.Output + + --- ### Syntax ```PowerShell -Show-RegEx [-Pattern] <String> [[-Match] <String[]>] [-Remove] [-Replace <String>] [-Transform <String>] [[-Option] {None | IgnoreCase | Multiline | ExplicitCapture | Compiled | Singleline | IgnorePatternWhitespace | RightToLeft | ECMAScript | CultureInvariant}] [-CaseSensitive] [-Timeout <TimeSpan>] [<CommonParameters>] +Show-RegEx [-Pattern] [[-Match] ] [-Remove] [-Replace ] [-Transform ] [[-Option] {None | IgnoreCase | Multiline | ExplicitCapture | Compiled | Singleline | IgnorePatternWhitespace | RightToLeft | ECMAScript | CultureInvariant}] [-CaseSensitive] [-Timeout ] [] ``` --- diff --git a/docs/Use-RegEx.md b/docs/Use-RegEx.md index 6f29f45..b7dd5a8 100644 --- a/docs/Use-RegEx.md +++ b/docs/Use-RegEx.md @@ -27,22 +27,22 @@ Use-RegEx is normally called with an alias that is the name of a saved RegEx, fo ### Examples #### EXAMPLE 1 ```PowerShell -"abc" | Use-RegEx -Pattern '.' +"abc" | Use-RegEx -Pattern '.' ``` #### EXAMPLE 2 ```PowerShell -# ?<TrueOrFalse> is a saved RegEx and alias to Use-RegEx +# ? is a saved RegEx and alias to Use-RegEx ``` #### EXAMPLE 3 ```PowerShell -$txt = "true or false or true or false" -$m = $txt | ?<TrueOrFalse> -Count 1 +$txt = "true or false or true or false" +$m = $txt | ? -Count 1 do { $m - $m = $m | ?<TrueOrFalse> -Count 1 -Scan -} while ($m) # Looping over each match until non are found. ?<TrueOrFalse> is an alias to Use-RegEx + $m = $m | ? -Count 1 -Scan +} while ($m) # Looping over each match until non are found. ? is an alias to Use-RegEx ``` --- @@ -564,22 +564,24 @@ A list of arguments. These are only valid if the regex is using a Generator scr --- ### Outputs -System.Text.RegularExpressions.Match +* [Text.RegularExpressions.Match](https://learn.microsoft.com/en-us/dotnet/api/System.Text.RegularExpressions.Match) -System.String +* [String](https://learn.microsoft.com/en-us/dotnet/api/System.String) + + +* [Management.Automation.PSObject](https://learn.microsoft.com/en-us/dotnet/api/System.Management.Automation.PSObject) -System.Management.Automation.PSObject --- ### Syntax ```PowerShell -Use-RegEx [[-Match] <String[]>] [-IsMatch] [-Measure] [-Count <Int32>] [-StartAt <Int32>] [-Remove] [-Replace <String>] [-Scan] [-ReplaceIf <IDictionary>] [-ReplaceEvaluator <ScriptBlock>] [-Split] [-Until] [-IncludeMatch] [-IncludeInputObject] [-Trim] [-Extract] [-PSTypeName <String>] [-Transform <String>] [-Coerce <IDictionary>] [-Where <ScriptBlock>] [-If <IDictionary>] [-Option {None | IgnoreCase | Multiline | ExplicitCapture | Compiled | Singleline | IgnorePatternWhitespace | RightToLeft | ECMAScript | CultureInvariant}] [-RightToLeft] [-Timeout <TimeSpan>] [-CaseSensitive] [-Pattern <String>] [-Generator <ScriptBlock>] [-ExpressionParameter <IDictionary>] [-ExpressionArgumentList <PSObject[]>] [<CommonParameters>] +Use-RegEx [[-Match] ] [-IsMatch] [-Measure] [-Count ] [-StartAt ] [-Remove] [-Replace ] [-Scan] [-ReplaceIf ] [-ReplaceEvaluator ] [-Split] [-Until] [-IncludeMatch] [-IncludeInputObject] [-Trim] [-Extract] [-PSTypeName ] [-Transform ] [-Coerce ] [-Where ] [-If ] [-Option {None | IgnoreCase | Multiline | ExplicitCapture | Compiled | Singleline | IgnorePatternWhitespace | RightToLeft | ECMAScript | CultureInvariant}] [-RightToLeft] [-Timeout ] [-CaseSensitive] [-Pattern ] [-Generator ] [-ExpressionParameter ] [-ExpressionArgumentList ] [] ``` ```PowerShell -Use-RegEx [-Match] <String[]> [-IsMatch] [-Measure] [-Count <Int32>] [-StartAt <Int32>] [-Remove] [-Replace <String>] [-Scan] [-ReplaceIf <IDictionary>] [-ReplaceEvaluator <ScriptBlock>] [-Split] [-Until] [-IncludeMatch] [-IncludeInputObject] [-Trim] [-Extract] [-PSTypeName <String>] [-Transform <String>] [-Coerce <IDictionary>] [-Where <ScriptBlock>] [-If <IDictionary>] [-Option {None | IgnoreCase | Multiline | ExplicitCapture | Compiled | Singleline | IgnorePatternWhitespace | RightToLeft | ECMAScript | CultureInvariant}] [-RightToLeft] [-Timeout <TimeSpan>] [-CaseSensitive] [-Generator <ScriptBlock>] [-ExpressionParameter <IDictionary>] [-ExpressionArgumentList <PSObject[]>] [<CommonParameters>] +Use-RegEx [-Match] [-IsMatch] [-Measure] [-Count ] [-StartAt ] [-Remove] [-Replace ] [-Scan] [-ReplaceIf ] [-ReplaceEvaluator ] [-Split] [-Until] [-IncludeMatch] [-IncludeInputObject] [-Trim] [-Extract] [-PSTypeName ] [-Transform ] [-Coerce ] [-Where ] [-If ] [-Option {None | IgnoreCase | Multiline | ExplicitCapture | Compiled | Singleline | IgnorePatternWhitespace | RightToLeft | ECMAScript | CultureInvariant}] [-RightToLeft] [-Timeout ] [-CaseSensitive] [-Generator ] [-ExpressionParameter ] [-ExpressionArgumentList ] [] ``` ---