登录 注册
其他 learn-regexregexregular-expression
46,051
Stars
6,095
Forks
873
Watchers
65
Open Issues
MIT
许可证
未知
语言
2017-07-22
创建时间
2025-08-25
最近更新

项目能做什么

轻松上手、由浅入深的正则表达式快速学习指南。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
<p align="center">
    <br/>
    <a href="https://github.com/ziishaned/learn-regex">	
        <img src="https://i.imgur.com/bYwl7Vf.png" alt="Learn Regex">
    </a>
</p>

## Translations:

* [English](README.md)
* [German](translations/README-de.md)
* [Español](translations/README-es.md)
* [Français](translations/README-fr.md)
* [Português do Brasil](translations/README-pt_BR.md)
* [中文版](translations/README-cn.md)
* [日本語](translations/README-ja.md)
* [한국어](translations/README-ko.md)
* [Turkish](translations/README-tr.md)
* [Greek](translations/README-gr.md)
* [Magyar](translations/README-hu.md)
* [Polish](translations/README-pl.md)
* [Русский](translations/README-ru.md)
* [Tiếng Việt](translations/README-vn.md)
* [Bahasa Indonesia](translations/README-id.md)
* [فارسی](translations/README-fa.md)
* [עברית](translations/README-he.md)


## What is Regular Expression?

<p>
    <a href="https://gum.co/learn-regex">
        <img src="https://img.shields.io/badge/-Download%20PDF%20-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="Download PDF">
    </a>
</p>

> A regular expression is a group of characters or symbols which is used to find a specific pattern in a text.

A regular expression is a pattern that is matched against a subject string from
left to right. Regular expressions are used to replace text within a string, 
validate forms, extract a substring from a string based on a pattern match, 
and so much more. The term "regular expression" is a mouthful, so you will usually
find the term abbreviated to "regex" or "regexp". 

Imagine you are writing an application and you want to set the rules for when a
user chooses their username. We want to allow the username to contain letters,
numbers, underscores and hyphens. We also want to limit the number of characters
in the username so it does not look ugly. We can use the following regular expression to
validate the username:

<br/><br/>
<p align="center">
  <img src="./img/regexp-en.png" alt="Regular expression">
</p>

The regular expression above can accept the strings `john_doe`, `jo-hn_doe` and
`john12_as`. It does not match `Jo` because that string contains an uppercase
letter and also it is too short.

## Table of Contents

- [Basic Matchers](#1-basic-matchers)
- [Meta Characters](#2-meta-characters)
  - [The Full Stop](#21-the-full-stop)
  - [Character Sets](#22-character-sets)
    - [Negated Character Sets](#221-negated-character-sets)
  - [Repetitions](#23-repetitions)
    - [The Star](#231-the-star)
    - [The Plus](#232-the-plus)
    - [The Question Mark](#233-the-question-mark)
  - [Braces](#24-braces)
  - [Capturing Groups](#25-capturing-groups)
      - [Non-Capturing Groups](#251-non-capturing-groups)
  - [Alternation](#26-alternation)
  - [Escaping Special Characters](#27-escaping-special-characters)
  - [Anchors](#28-anchors)
    - [The Caret](#281-the-caret)
    - [The Dollar Sign](#282-the-dollar-sign)
- [Shorthand Character Sets](#3-shorthand-character-sets)
- [Lookarounds](#4-lookarounds)
 
阅读完整原文

商业机会分析 AI 生成

交互式 Regex 刷题与技能认证平台

产品构想基于仓库的教程大纲,构建一个类似 LeetCode/RegexCrossword 的渐进式交互闯关与认证平台,提供实时运行验证、提示及技能测评证书。
核心功能分级闯关任务系统、即时语法测试沙盒、错误解析引擎、完成度与技能认证证书导出。
目标用户求职面试备考生、需要系统补全基础技能的初级程序员、计算机专业学生。
难度/周期中等 · 4-6周 · 成本:轻量级 Web 服务器 + 前端沙盒(主要为前端执行,服务器成本低,约 $10-30/月)。
收费模式免费开放基础关卡;高级挑战关卡、面试真题题库、官方认证证书采用买断制(如 $9.9-$19.9)或会员订阅。
竞争风险市面上存在大量免费工具(如 RegexOne、Regex101),用户付费转化门槛高。
依据 已验证事实

付费电子书与进阶实战手册(多语言 Gumroad 发售)

产品构想利用项目中已经存在的 Gumroad 链接(README 包含 gum.co/learn-regex)以及 17+ 种语言社区的优势,整理出品质更高的精编电子书、速查表(CheatSheet)及真实业务案例集合(如合规校验、日志分析)。
核心功能PDF/ePub 格式电子书、高清打印版速查卡片、50+ 个生产环境真实场景 Regex 方案库、多语言版本分发。
目标用户喜欢离线阅读、收藏速查手册的开发者及技术文档读者。
难度/周期低 · 2-3周 · 成本:几乎为零(设计排版耗时 + Gumroad 平台交易抽成)。
收费模式Gumroad/Leanpub 单本售价 $5 - $15,支持“按你想付的金额付费”。
竞争风险开源版本内容本身非常详尽,纯内容打包的溢价空间有限。
依据 已验证事实

IDE 插件与智能 Regex 生成辅助工具

产品构想开发 VS Code / JetBrains 插件,结合开源文档速查与 AI/规则辅助,实现自然语言生成 Regex、正则可视化拆解与单元测试自动生成。
核心功能选中文本快捷解释 Regex、自然语言转 Regex 引擎、边界用例自动生成与测试、内置 learn-regex 离线速查词典。
目标用户日常高频处理数据抽取、日志分析和表单校验的资深/中级工程师。
难度/周期中等 · 1-2个月 · 成本:IDE 插件分发免费,若调用外部 LLM API 则按用量计费(前期约 $20-50/月)。
收费模式基础功能与离线速查免费;高级特性(批量测试用例生成、复杂 AI 推理)按月度订阅($3-$5/月)或 Token 额度购买。
竞争风险需与 GitHub Copilot 等通用 AI 编程助手竞争,若没有极深度的正则垂直调试功能,难以维系留存。
依据 AI推测
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
aykutkardas/regexlearn.com 中文介绍暂未生成
Learn RegEx step by step, from zero to advanced.
4,119 TypeScript
cdoco/learn-regex-zh 中文介绍暂未生成
:cn: 翻译: 学习正则表达式的简单方法
2,720 -
milaan9/07_Python_Advanced_Topics 中文介绍暂未生成
You'll learn about Iterators, Generators, Closure, Decorator
306 Jupyter Notebook
SwiftFiddle/swiftregex 中文介绍暂未生成
Swift Regex is an online tool to learn, build and test Swift
192 Swift
dwyl/learn-regex 中文介绍暂未生成
:interrobang: A simple REGular EXpression tutorial in JavaSc
120 -
bookworm52/EthicalHackingFromScratch 中文介绍暂未生成
Welcome to my comprehensive course on python programming and
120 -
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2017-07-22,最近推送 2025-08-25
社区活跃Star 46,051 / Fork 6,095 / Issue 65(数据支持,可自行核实)
许可证MIT
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/ziishaned/learn-regex.git
cd learn-regex
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。