Skip to content

Commit c3429f7

Browse files
author
James Brundage
committed
Updating RegexLiteral Examples
1 parent edfc541 commit c3429f7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Transpilers/Syntax/RegexLiteral.psx.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,21 @@
1111
{
1212
'/[a|b]/'
1313
} | .>PipeScript
14+
15+
# This will become:
16+
17+
[regex]::new('[a|b]', 'IgnoreCase')
1418
.EXAMPLE
1519
{
1620
"/[$a|$b]/"
1721
} | .>PipeScript
22+
23+
# This will become:
24+
25+
[regex]::new("[$a|$b]", 'IgnoreCase'
1826
.EXAMPLE
19-
{@'
27+
{
28+
@'
2029
/
2130
# Heredocs Regex literals will have IgnorePatternWhitespace by default, which allows comments
2231
^ # Match the string start
@@ -28,7 +37,7 @@
2837
.EXAMPLE
2938
{
3039
$Keywords = "looking", "for", "these", "words"
31-
@"
40+
@"
3241
/
3342
# Double quoted heredocs can still contain variables
3443
[\s\p{P}]{0,1} # Whitespace or punctuation

0 commit comments

Comments
 (0)