File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 2222
2323 # This will become:
2424
25- [regex]::new("[$a|$b]", 'IgnoreCase'
25+ [regex]::new("[$a|$b]", 'IgnoreCase')
2626. EXAMPLE
2727 {
2828@'
3434'@
3535 } | .>PipeScript
3636
37+ # This will become:
38+
39+ [regex]::new(@'
40+ # Heredocs Regex literals will have IgnorePatternWhitespace by default, which allows comments
41+ ^ # Match the string start
42+ (?<indent>\s{0,1})
43+ '@, 'IgnorePatternWhitespace,IgnoreCase')
44+
3745. EXAMPLE
46+ $Keywords = "looking", "for", "these", "words"
47+
3848 {
39- $Keywords = "looking", "for", "these", "words"
4049@"
4150/
4251# Double quoted heredocs can still contain variables
@@ -46,6 +55,16 @@ $($Keywords -join '|') # followed by keywords
4655/
4756"@
4857 } | .>PipeScript
58+
59+
60+ # This will become:
61+
62+ [regex]::new(@"
63+ # Double quoted heredocs can still contain variables
64+ [\s\p{P}]{0,1} # Whitespace or punctuation
65+ $($Keywords -join '|') # followed by keywords
66+ [\s\p{P}]{0,1} # followed by whitespace or punctuation
67+ "@, 'IgnorePatternWhitespace,IgnoreCase')
4968#>
5069[ValidatePattern (@'
5170^ # Start anchor
You can’t perform that action at this time.
0 commit comments