Skip to content

Commit f061403

Browse files
Merge pull request #125 from StartAutomating/IrregularUpdates
Irregular updates
2 parents 986b233 + a1811cc commit f061403

34 files changed

+1384
-308
lines changed

.github/workflows/IrregularTests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,15 @@ jobs:
419419
$ModulePath,
420420
421421
[string[]]
422-
$Exclude = @('*.png', '*.mp4', '*.jpg','*.jpeg')
422+
$Exclude = @('*.png', '*.mp4', '*.jpg','*.jpeg', '*.gif')
423423
)
424424
425425
$gitHubEvent = if ($env:GITHUB_EVENT_PATH) {
426426
[IO.File]::ReadAllText($env:GITHUB_EVENT_PATH) | ConvertFrom-Json
427427
} else { $null }
428428
429429
if (-not $Exclude) {
430-
$Exclude = @('*.png', '*.mp4', '*.jpg','*.jpeg')
430+
$Exclude = @('*.png', '*.mp4', '*.jpg','*.jpeg', '*.gif')
431431
}
432432
433433

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
## 0.6.9:
1+
## 0.7.0:
2+
* New Patterns:
3+
* ANSI
4+
* ?<ANSI_Code> (Fixes #123)
5+
* ?<ANSI_Color> (Fixes #124)
6+
* ?<ANSI_DefaultColor>
7+
* ?<ANSI_4BitColor>
8+
* ?<ANSI_8BitColor>
9+
* ?<ANSI_24BitColor>
10+
* Mustache
11+
* ?<Mustache_Tag> (Fixes #121)
12+
* New-Regex -LiteralCharacter '_' no longer escapes (Fixes #122)
13+
* Reducing module size (excluding assets) (Fixes #118)
14+
---
15+
16+
## 0.6.9:
217
* Adding ?<Markdown_Link> (Fixes #117)
318
* GitHub Action now prefers local bits (Fixes #111)
419
* Using PipeScript to enhance the repository experience (Fixes #119)

Irregular.psd1

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@{
2-
ModuleVersion = '0.6.9'
2+
ModuleVersion = '0.7.0'
33
RootModule = 'Irregular.psm1'
44
Description = 'Regular Expressions made Strangely Simple'
55
FormatsToProcess = 'Irregular.format.ps1xml'
@@ -14,6 +14,21 @@
1414
LicenseURI = 'https://github.com/StartAutomating/Irregular/blob/master/LICENSE'
1515
IconURI = 'https://github.com/StartAutomating/Irregular/blob/master/Assets/Irregular_600_Square.png'
1616
ReleaseNotes = @'
17+
## 0.7.0:
18+
* New Patterns:
19+
* ANSI
20+
* ?<ANSI_Code> (Fixes #123)
21+
* ?<ANSI_Color> (Fixes #124)
22+
* ?<ANSI_DefaultColor>
23+
* ?<ANSI_4BitColor>
24+
* ?<ANSI_8BitColor>
25+
* ?<ANSI_24BitColor>
26+
* Mustache
27+
* ?<Mustache_Tag> (Fixes #121)
28+
* New-Regex -LiteralCharacter '_' no longer escapes (Fixes #122)
29+
* Reducing module size (excluding assets) (Fixes #118)
30+
---
31+
1732
## 0.6.9:
1833
* Adding ?<Markdown_Link> (Fixes #117)
1934
* GitHub Action now prefers local bits (Fixes #111)

New-RegEx.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@
684684
$ccLookup[$notcc]
685685
})
686686

687-
$lc = @($literalCharacter -replace '[\p{P}\p{S}]', '\$0')
687+
$lc = @($literalCharacter -replace '[\p{P}\p{S}-[_]]', '\$0')
688688
$notLC = @($ExcludeliteralCharacter -replace '[\p{P}\p{S}]', '\$0')
689689

690690
$charSet = @(

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h2>Regular Expressions made Strangely Simple</h2>
44
<h3>A PowerShell module that helps you understand, use, and build Regular Expressions.</h3>
55
<h4>
6-
<a href='https://github.com/StartAutomating/Irregular/releases/tag/v0.6.9'>v 0.6.9 </a>
6+
<a href='https://github.com/StartAutomating/Irregular/releases/tag/v0.7.0'>v 0.7.0 </a>
77
</h4>
88
<a href='https://www.powershellgallery.com/packages/Irregular/'>
99
<img src='https://img.shields.io/powershellgallery/dt/Irregular' />
@@ -32,7 +32,7 @@ Once you understand some basics of that syntax, regular expressions become a lot
3232
3. A Regex can have comments! ( # Like this in .NET ( or like (?#this comment) in ECMAScript ) ).
3333
4. You don't have to do it all in one expression!
3434

35-
Irregular comes with 111 useful [named expressions](SavedPatterns.md), and lets you create more.
35+
Irregular comes with 118 useful [named expressions](SavedPatterns.md), and lets you create more.
3636

3737
To see the expressions that ship with Irregular, run:
3838

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$myName = ($MyInvocation.MyCommand.ScriptBlock.File | Split-Path -Leaf) -replace '\.source', '' -replace '\.ps1', '.txt'
2+
$myRoot = $MyInvocation.MyCommand.ScriptBlock.File | Split-Path
3+
4+
New-RegEx -Description "Matches an ANSI 24-bit color" -Modifier IgnoreCase -Not |
5+
New-RegEx -CharacterClass Escape -Comment 'An Escape' |
6+
New-RegEx -LiteralCharacter '[' -Comment 'Followed by a bracket' |
7+
New-RegEx -Pattern '38;2;' |
8+
New-RegEx -Name Color -Pattern (
9+
New-Regex -Name Red -Pattern '(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})' -Comment 'Red is the first 0-255 value' |
10+
New-RegEx -Pattern ';' |
11+
New-Regex -Name Red -Pattern '(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})' -Comment 'Green is the second 0-255 value' |
12+
New-RegEx -Pattern ';' |
13+
New-Regex -Name Blue -Pattern '(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})' -Comment 'Blue is the third 0-255 value' |
14+
New-RegEx -Pattern 'm'
15+
) |
16+
Set-Content -Path (Join-Path $myRoot $myName)

RegEx/ANSI/24BitColor.regex.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Matches an ANSI 24-bit color
2+
(?-i)\e # An Escape
3+
\[ # Followed by a bracket
4+
38;2;(?<Color>(?<Red>(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Red is the first 0-255 value
5+
;(?<Red>(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Green is the second 0-255 value
6+
;(?<Blue>(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Blue is the third 0-255 value
7+
m)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$myName = ($MyInvocation.MyCommand.ScriptBlock.File | Split-Path -Leaf) -replace '\.source', '' -replace '\.ps1', '.txt'
2+
$myRoot = $MyInvocation.MyCommand.ScriptBlock.File | Split-Path
3+
4+
New-RegEx -Description "Matches an ANSI 3 or 4-bit color" |
5+
New-RegEx -CharacterClass Escape -Comment 'An Escape' |
6+
New-RegEx -LiteralCharacter '[' -Comment 'Followed by a bracket' |
7+
New-RegEx -Pattern (
8+
New-RegEx -Pattern 1 -Optional -Name IsBright |
9+
New-RegEx -LiteralCharacter ';' -Optional |
10+
New-RegEx -Pattern '3[0-7]' -Name ForegroundColor -Optional |
11+
New-RegEx -If ForegroundColor -Then 'm' -Else (
12+
New-RegEx -Pattern '4[0-7]' -Name BackgroundColor |
13+
New-RegEx -Pattern 'm' -Modifier IgnoreCase -Not
14+
)
15+
) -Name Color |
16+
Set-Content -Path (Join-Path $myRoot $myName)

RegEx/ANSI/4BitColor.regex.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Matches an ANSI 3 or 4-bit color
2+
\e # An Escape
3+
\[ # Followed by a bracket
4+
(?<Color>(?<IsBright>1)?\;?(?<ForegroundColor>3[0-7])?(?(ForegroundColor)(m)|((?<BackgroundColor>4[0-7])m)))
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
$myName = ($MyInvocation.MyCommand.ScriptBlock.File | Split-Path -Leaf) -replace '\.source', '' -replace '\.ps1', '.txt'
2+
$myRoot = $MyInvocation.MyCommand.ScriptBlock.File | Split-Path
3+
4+
New-RegEx -Description "Matches an ANSI 8-bit color" -Modifier IgnoreCase -Not |
5+
New-RegEx -CharacterClass Escape -Comment 'An Escape' |
6+
New-RegEx -LiteralCharacter '[' -Comment 'Followed by a bracket' |
7+
New-RegEx -Pattern '38;5;' |
8+
New-RegEx -Name Color -Pattern (
9+
New-RegEx -Atomic -Or @(
10+
New-Regex -Name StandardColor -Pattern '[0-7]' -Comment '0 -7 are standard colors' |
11+
New-RegEx -Pattern m
12+
New-Regex -Name BrightColor -Pattern '(?>[8-9]|1[0-5])' -Comment '8-15 are bright colors' |
13+
New-RegEx -Pattern m
14+
New-Regex -Name CubeColor -Pattern '(?>[0-2][0-3][0-1]|[0-1]\d\d|\d{1,2})' -Comment '16-231 are cubed colors' |
15+
New-RegEx -Pattern m
16+
New-Regex -Name GrayscaleColor -Pattern '(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})' -Comment '232-255 are grayscales' |
17+
New-RegEx -Pattern m
18+
)
19+
) |
20+
Set-Content -Path (Join-Path $myRoot $myName)

0 commit comments

Comments
 (0)