-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathStartTag.regex.ps1
More file actions
25 lines (24 loc) · 740 Bytes
/
StartTag.regex.ps1
File metadata and controls
25 lines (24 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<#
.Synopsis
Gets Start tags
.Description
Gets one or more start markup tags. By default, gets start anchor tags.
#>
param(
[Parameter(ValueFromRemainingArguments=$true)]
[string[]]$Tag = @('a')
)
@"
\< # The tag Start
(?<TagName>$($Tag -join '|')) # The name of the Tag is any non number of non-word characters
(?<TagAttributes> # It's attributes are
\s{1,} # initial whitespace
.+? # then anything until
(?= # the close of the tag.
(?> # The close of the tag can be either (IsClosed)/> or (IsOpen)>
\z|(?<IsClosed>/>)|(?<IsOpen>\>)
)
)
)?
(?>/>|\>)
"@