Compare commits

...

2 Commits

Author SHA1 Message Date
39fb6be9d7
ph-bookshelf update 2023-03-28 17:54:30 +08:00
78fdd5f654
add regex highlight intro 2023-03-27 23:49:24 +08:00
3 changed files with 41 additions and 19 deletions

View File

@ -1,3 +1,8 @@
---
configurations:
prism.plugins: "treeview"
---
代码纯手打,没有经过 IDE 查错,如发现错误还请立即 issue
## 创建资源文件索引对象
@ -18,14 +23,14 @@ ResourcesPackage pack = new ResourcesPackage(Test.class, "assets");
第二个参数是在项目文件为根目录的路径下,你的资源文件的位置。
一般来说在IDE等项目管理环境下一个项目的源文件路径如下
```tree
src
╠═main
║ ╟─java
║ ╙─resources
╚═test
╟─java
╙─resources
```treeview
src/
|-- main/
| |-- java/
| └── resources/
└── test/
|-- java/
└── resources/
```
这个路径指的就是在{.lang-url}`src/main/resources`目录下的{.lang-url}`assets`文件夹。
@ -47,15 +52,15 @@ public ResDir getResDir (String path) throws IOException;
例如如果一个项目的 resources结构如下
```tree
resources
╠═assets
║ ╟─propertes.io
║ ╚═lang
║ ╚═default.lang
╚═idn
╟─ios
╙─windows
```treeview
resources/
|-- assets/
| |-- propertes.io
| └── lang/
| └── default.lang
└── idn/
|-- ios/
└── windows/
```
若要获取`default.lang`文件,则使用以下方法:

View File

@ -2,12 +2,20 @@
title: RegEx 着色
configurations:
regex.highlight: 'true'
prism: 'true'
---
# 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">
@ -93,14 +101,23 @@ configurations:
<span class="reg-anchor">$</span>
</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>
<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&=-]+)?$`
<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>
<small>regex code itself</small>
`\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>
<small>regex code itself</small>
`([A-Z])\w+\x7kk\xaf5ke\xne\u17kc\u1ea7nss`

@ -1 +1 @@
Subproject commit 7f73bc1c1a79b86aa79c89365bab1f270f149b38
Subproject commit 4d442fee379788ea285667bf0b5ad8a7d1c4735a