添加 regex 着色测试页,morny sync

This commit is contained in:
A.C.Sukazyo Eyre 2022-10-31 14:35:14 +08:00
parent 9ea4d18c6d
commit f28a3b4583
Signed by: Eyre_S
GPG Key ID: C17CE40291207874
3 changed files with 100 additions and 1 deletions

View File

@ -0,0 +1,96 @@
<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-escape-char">\.</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">+</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 regex_dbg">^(?:https?://)?((?:(?:c\\.)?vx|fx|www\\.)?twitter\\.com)/((\w{1,})/status/(\d+)(?:/photo/(\d+))?)/?(\?[\w&=-]+)?$</code>
`^(?:https?://)?((?:(?:c\.)?vx|fx|www\.)?twitter\.com)/((\w{1,})/status/(\d+)(?:/photo/(\d+))?)/?(\?[\w&=-]+)?$`
<code class="regex regex_dbg">\\92\\1^\\d{0,3,5}\\n{9c}\\b{0,2}(\\B{,5}){3})\\01{}\\2{,}\\001${0,}</code>
`\92\1^\d{0,3,5}\n{9c}\b{0,2}(\b{,5}){3})\01{}\2{,}\001${0,}`
<code class="regex regex_dbg">([A-Z])\\w+\\x7kk\\xaf5ke\\xne\\u17kc\\u1ea7nss</code>
`([A-Z])\w+\x7kk\xaf5ke\xne\u17kc\u1ea7nss`

View File

@ -32,5 +32,8 @@
</books> </books>
<rootBook id="%root" name="Workshop Documentations"> <rootBook id="%root" name="Workshop Documentations">
<Page id="main" name="book.sukazyo.cc:: Rebuild In Progress" /> <Page id="main" name="book.sukazyo.cc:: Rebuild In Progress" />
<Chapter name="__test_collection__">
<Page id="test-regex-highlight" name="RegEx 着色" />
</Chapter>
</rootBook> </rootBook>
</BookShelf> </BookShelf>

2
morny

@ -1 +1 @@
Subproject commit e324fbd7926f876e6559aa322c7aed8efc60a865 Subproject commit 13153c48a69aa7fd5d1063f9296512a167346676