Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,55 +0,0 @@
function Expand-Braces ( [string]$String )
{
$Escaped = $False
$Stack = New-Object System.Collections.Stack
$ClosedBraces = $BracesToParse = $Null
ForEach ( $i in 0..($String.Length-1) )
{
Switch ( $String[$i] )
{
'\' {
$Escaped = -not $Escaped
break
}
'{' {
If ( -not $Escaped ) { $Stack.Push( [pscustomobject]@{ Delimiters = @( $i ) } ) }
}
',' {
If ( -not $Escaped -and $Stack.Count ) { $Stack.Peek().Delimiters += $i }
}
'}' {
If ( -not $Escaped -and $Stack.Count )
{
$Stack.Peek().Delimiters += $i
$ClosedBraces = $Stack.Pop()
If ( $ClosedBraces.Delimiters.Count -gt 2 )
{
$BracesToParse = $ClosedBraces
}
}
}
default { $Escaped = $False }
}
}
If ( $BracesToParse )
{
$Start = $String.Substring( 0, $BracesToParse.Delimiters[0] )
$End = $String.Substring( $BracesToParse.Delimiters[-1] + 1 )
ForEach ( $i in 0..($BracesToParse.Delimiters.Count-2) )
{
$Option = $String.Substring( $BracesToParse.Delimiters[$i] + 1, $BracesToParse.Delimiters[$i+1] - $BracesToParse.Delimiters[$i] - 1 )
Expand-Braces ( $Start + $Option + $End )
}
}
Else
{
$String
}
}

View file

@ -1,14 +0,0 @@
$TestStrings = @(
'It{{em,alic}iz,erat}e{d,}, please.'
'~/{Downloads,Pictures}/*.{jpg,gif,png}'
'{,{,gotta have{ ,\, again\, }}more }cowbell!'
'{}} some }{,{\\{ edge, edge} \,}{ cases, {here} \\\\\}'
)
ForEach ( $String in $TestStrings )
{
''
$String
'------'
Expand-Braces $String
}