Skip to content

Commit 6aefcb0

Browse files
feat: MarkX.LiquidPattern ( Fixes #46 )
1 parent 8b9dba9 commit 6aefcb0

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Types/MarkX/get_LiquidPattern.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<#
2+
.SYNOPSIS
3+
Get the Liquid Pattern
4+
.DESCRIPTION
5+
Gets the regular expression pattern used to match Liquid tags.
6+
#>
7+
param()
8+
$liquidPattern = @(
9+
'(?>'
10+
'\{\%\s{0,}'
11+
'(?<tag>[^\%]+)'
12+
'\s{0,}\%}'
13+
14+
'|'
15+
16+
'(?<noescape>\{{3})'
17+
'(?<expression>[^\}]+)'
18+
'\}{3}'
19+
20+
'|'
21+
22+
'\{{2}'
23+
'(?<expression>[^\}]+)'
24+
'\}{2}'
25+
')'
26+
) -join ''
27+
28+
return [Regex]::new($liquidPattern)

0 commit comments

Comments
 (0)