|
|
@ -2,12 +2,20 @@
|
|
|
|
title: RegEx 着色
|
|
|
|
title: RegEx 着色
|
|
|
|
configurations:
|
|
|
|
configurations:
|
|
|
|
regex.highlight: 'true'
|
|
|
|
regex.highlight: 'true'
|
|
|
|
|
|
|
|
prism: 'true'
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
# regex highight
|
|
|
|
# regex highight
|
|
|
|
|
|
|
|
|
|
|
|
[source](https://github.com/suk-ws/regex-colorizer)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[regex-colorizer]: https://github.com/suk-ws/regex-colorizer
|
|
|
|
|
|
|
|
[Prism]: https://prismjs.com
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[source][regex-colorizer]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<small>base colorized by *[regexr.com](https://regexr.com)*</small>
|
|
|
|
<code class="regex"><span class="reg-anchor">^</span><span class="reg-group"><span class="reg-group-tag">(?:</span><span class="reg-char">https</span><span class="reg-quantifier">?</span><span class="reg-char">://</span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-group"><span class="reg-group-tag">(?:</span><span class="reg-group"><span class="reg-group-tag">(?:</span><span class="reg-char">c</span><span class="reg-cescape">\\.</span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-char">vx</span><span class="reg-alter">|</span><span class="reg-char">fx</span><span class="reg-alter">|</span><span class="reg-char">www</span><span class="reg-cescape">\\.</span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-char">twitter</span><span class="reg-cescape">\\.</span><span class="reg-char">com</span><span class="reg-group-tag">)</span></span><span class="reg-char">/</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-cclass">\w</span><span class="reg-quantifier">{1,}</span><span class="reg-group-tag">)</span></span><span class="reg-char">/status/</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-cclass">\d</span><span class="reg-quantifier">+</span><span class="reg-group-tag">)</span></span><span class="reg-group"><span class="reg-group-tag">(?:</span><span class="reg-char">/photo/</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-cclass">\d</span><span class="reg-quantifier">+</span><span class="reg-group-tag">)</span></span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-group-tag">)</span></span><span class="reg-char">/</span><span class="reg-quantifier">?</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-cescape">\?</span><span class="reg-set"><span class="reg-set-tag">[</span><span class="reg-cclass">\w</span><span class="reg-char">&=-</span><span class="reg-set-tag">]</span></span><span class="reg-quantifier">+</span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-anchor">$</span></code>
|
|
|
|
<code class="regex"><span class="reg-anchor">^</span><span class="reg-group"><span class="reg-group-tag">(?:</span><span class="reg-char">https</span><span class="reg-quantifier">?</span><span class="reg-char">://</span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-group"><span class="reg-group-tag">(?:</span><span class="reg-group"><span class="reg-group-tag">(?:</span><span class="reg-char">c</span><span class="reg-cescape">\\.</span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-char">vx</span><span class="reg-alter">|</span><span class="reg-char">fx</span><span class="reg-alter">|</span><span class="reg-char">www</span><span class="reg-cescape">\\.</span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-char">twitter</span><span class="reg-cescape">\\.</span><span class="reg-char">com</span><span class="reg-group-tag">)</span></span><span class="reg-char">/</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-cclass">\w</span><span class="reg-quantifier">{1,}</span><span class="reg-group-tag">)</span></span><span class="reg-char">/status/</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-cclass">\d</span><span class="reg-quantifier">+</span><span class="reg-group-tag">)</span></span><span class="reg-group"><span class="reg-group-tag">(?:</span><span class="reg-char">/photo/</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-cclass">\d</span><span class="reg-quantifier">+</span><span class="reg-group-tag">)</span></span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-group-tag">)</span></span><span class="reg-char">/</span><span class="reg-quantifier">?</span><span class="reg-group"><span class="reg-group-tag">(</span><span class="reg-cescape">\?</span><span class="reg-set"><span class="reg-set-tag">[</span><span class="reg-cclass">\w</span><span class="reg-char">&=-</span><span class="reg-set-tag">]</span></span><span class="reg-quantifier">+</span><span class="reg-group-tag">)</span></span><span class="reg-quantifier">?</span><span class="reg-anchor">$</span></code>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <code class="regex">
|
|
|
|
<!-- <code class="regex">
|
|
|
@ -93,14 +101,23 @@ configurations:
|
|
|
|
<span class="reg-anchor">$</span>
|
|
|
|
<span class="reg-anchor">$</span>
|
|
|
|
</code> -->
|
|
|
|
</code> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<small>regex code auto-colorized by *[regex-colorizer]*</small>
|
|
|
|
<code class="regex regex_dbg">^(?:https?://)?((?:(?:c\\.)?vx|fx|www\\.)?twitter\\.com)/((\w{1,})/status/(\d+)(?:/photo/(\d+))?)/?(\?[\w&=-]+)?$</code>
|
|
|
|
<code class="regex regex_dbg">^(?:https?://)?((?:(?:c\\.)?vx|fx|www\\.)?twitter\\.com)/((\w{1,})/status/(\d+)(?:/photo/(\d+))?)/?(\?[\w&=-]+)?$</code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<small>regex code auto-colorized by *[Prism]*</small>
|
|
|
|
|
|
|
|
`^(?:https?://)?((?:(?:c\.)?vx|fx|www\.)?twitter\.com)/((\w{1,})/status/(\d+)(?:/photo/(\d+))?)/?(\?[\w&=-]+)?$`{.lang-regex}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<small>regex code itself</small>
|
|
|
|
`^(?:https?://)?((?:(?:c\.)?vx|fx|www\.)?twitter\.com)/((\w{1,})/status/(\d+)(?:/photo/(\d+))?)/?(\?[\w&=-]+)?$`
|
|
|
|
`^(?:https?://)?((?:(?:c\.)?vx|fx|www\.)?twitter\.com)/((\w{1,})/status/(\d+)(?:/photo/(\d+))?)/?(\?[\w&=-]+)?$`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<small>regex code auto-colorized by *[regex-colorizer]*</small>
|
|
|
|
<code class="regex regex_dbg">\\92\\1^\\d{0,3,5}\\n{9c}\\b{0,2}(\\B{,5}){3})\\01{}\\2{,}\\001${0,}</code>
|
|
|
|
<code class="regex regex_dbg">\\92\\1^\\d{0,3,5}\\n{9c}\\b{0,2}(\\B{,5}){3})\\01{}\\2{,}\\001${0,}</code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<small>regex code itself</small>
|
|
|
|
`\92\1^\d{0,3,5}\n{9c}\b{0,2}(\b{,5}){3})\01{}\2{,}\001${0,}`
|
|
|
|
`\92\1^\d{0,3,5}\n{9c}\b{0,2}(\b{,5}){3})\01{}\2{,}\001${0,}`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<small>regex code auto-colorized by *[regex-colorizer]*</small>
|
|
|
|
<code class="regex regex_dbg">([A-Z])\\w+\\x7kk\\xaf5ke\\xne\\u17kc\\u1ea7nss</code>
|
|
|
|
<code class="regex regex_dbg">([A-Z])\\w+\\x7kk\\xaf5ke\\xne\\u17kc\\u1ea7nss</code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<small>regex code itself</small>
|
|
|
|
`([A-Z])\w+\x7kk\xaf5ke\xne\u17kc\u1ea7nss`
|
|
|
|
`([A-Z])\w+\x7kk\xaf5ke\xne\u17kc\u1ea7nss`
|
|
|
|