Snapshot of gedoor/learn-regex-zh: 52★. :cn: 翻译: 学习正则表达式的简单方法
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
i 修饰符用于执行不区分大小写匹配。例如正则表达式 /The/gi,表示: 大写字母 T,后跟小写字母 h,后跟字母 e。
但是在正则匹配结束时 i 标记会告诉正则表达式引擎忽略这种情况。正如你所看到的,我们还使用了 g 标记,因为我们要在整个输入字符串中搜索匹配。
"The" => The fat cat sat on the mat.
"/The/gi" => The fat cat sat on the mat.
5.2 全局搜索
g 修饰符用于执行全局匹配 (会查找所有匹配,不会在查找到第一个匹配时就停止)。
例如正则表达式 /.(at)/g,表示: 除换行符之外的任意字符,后跟小写字母 a,后跟小写字母 t。
因为我们在正则表达式的末尾使用了 g 标记,它会从整个输入字符串中找到每个匹配项。
".(at)" => The fat cat sat on the mat.
"/.(at)/g" => The fatcatsat on the mat.
5.3 多行匹配
m 修饰符被用来执行多行的匹配。正如我们前面讨论过的 (^, $),使用定位符来检查匹配字符是输入字符串开始或者结束。但是我们希望每一行都使用定位符,所以我们就使用 m 修饰符。
例如正则表达式 /at(.)?$/gm,表示: 小写字母 a,后跟小写字母 t,匹配除了换行符以外任意字符零次或一次。而且因为 m 标记,现在正则表达式引擎匹配字符串中每一行的末尾。
TopGit's last sync did not record any GitHub topics for gedoor/learn-regex-zh. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on gedoor/learn-regex-zh?
The most recent commit recorded on gedoor/learn-regex-zh was 9.1 years ago, based on the GitHub push timestamp. The repository has 23 forks — one of the better signals of community interest.
How many stars does gedoor/learn-regex-zh have?
gedoor/learn-regex-zh has 52 GitHub stars — refresh the page for the live number, or check github.com/gedoor/learn-regex-zh. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What is gedoor/learn-regex-zh?
gedoor/learn-regex-zh (gedoor/learn-regex-zh) is a multi-language project on GitHub. From the project's own README: :cn: 翻译: 学习正则表达式的简单方法
What language is gedoor/learn-regex-zh written in?
TopGit's last sync did not record a primary language for gedoor/learn-regex-zh. Open the repository on GitHub to see the full breakdown by file extension.
Read full README in the tab above.
Is learn-regex-zh worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of learn-regex-zh.