-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathLinkedData.regex.txt
More file actions
11 lines (10 loc) · 785 Bytes
/
LinkedData.regex.txt
File metadata and controls
11 lines (10 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
# Matches JSON Linked Data (JSON within HTML)
<script # Match <script tag
\s{1,} # Then whitespace
type= # Then the type= attribute (this regex will only match if it is first)
[\"\'] # Double or Single Quotes
application/ld\+json # The type that indicates linked data
[\"\'] # Double or Single Quotes
[^>]{0,} # Match anything until the end of the start tag
\> # Match the end of the start tag
(?<JsonContent>(?:.|\s){0,}?(?=\z|</script>)) # Anything until the end tag is JSONContent