V2EX  ›  英汉词典

Regular Expression

Definition / 定义

regular expression(正则表达式):一种用来描述字符串模式的符号写法,常用于查找、匹配、替换文本(例如验证邮箱、提取日期、批量改名等)。在不同语言/工具中语法略有差异(如 POSIX、PCRE、JavaScript 等)。

Pronunciation / 发音

/ˌrɛɡjələr ɪkˈsprɛʃən/

Examples / 例句

I used a regular expression to find all the email addresses.
我用正则表达式找出了所有的邮箱地址。

To validate user input, the program applies a regular expression that allows letters, numbers, and underscores but rejects spaces and punctuation.
为验证用户输入,程序使用一个正则表达式:允许字母、数字和下划线,但拒绝空格和标点符号。

Etymology / 词源

该术语由 regular(规则的)+ expression(表达式) 组成,源于计算理论中的“正规语言(regular languages)”概念;在 20 世纪中期由数学家与计算机科学家(如 Stephen Kleene)在形式语言研究中系统化,后来广泛进入编程与文本处理领域。

Related Words / 相关词

Literary Works / 文学作品

  • Mastering Regular Expressions(Jeffrey E. F. Friedl)
  • Compilers: Principles, Techniques, and Tools(Aho, Lam, Sethi, Ullman,“龙书”)
  • Introduction to Automata Theory, Languages, and Computation(Hopcroft, Motwani, Ullman)
  • The Unix Programming Environment(Kernighan & Pike,涉及文本处理与模式匹配语境)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   680 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 7ms · UTC 21:13 · PVG 05:13 · LAX 13:13 · JFK 16:13
♥ Do have faith in what you're doing.