正则语言和正则表达式_探索正则表达式背后的语言学

正则语言和正则表达式

by Alaina Kafkes

由Alaina Kafkes

探索正则表达式背后的语言学 (Exploring the Linguistics Behind Regular Expressions)

语言突破是如何在代码中结束的 (How a linguistic breakthrough ended up in code)

Regular expressions inspire fear in new and experienced programmers alike. When I first saw a regular expression — often abbreviated as “regex” — I remember feeling dizzy from looking at the litany of parentheses, asterisks, letters, and numbers. Regular expressions seemed nonsensical, impenetrable.

正则表达式激发了新手和有经验的程序员的恐惧。 当我第一次看到正则表达式(通常缩写为“正则表达式”)时,我记得看括号,星号,字母和数字的连字符会感到头晕。 正则表达式似乎毫无意义,难以理解。

I expected regular expressions to crop up again in my upper-level computer science coursework — maybe by then I’d finally feel ready to tackle them — but I encountered them in an introductory class that I had put off until my senior year. The purpose of this course was to draw students who had never written a line of code into CS by introducing them to concepts like cryptography, human-computer interaction, machine learning — you know, only the latest and greatest of tech buzzwords.

我期望正则表达式会在我的高级计算机科学课程中再次出现-也许到那时我终于准备好应对它们了-但是我在入门班上遇到了它们,直到我高四时为止。 本课程的目的是通过向从未向CS编写过代码的行的学生介绍密码术,人机交互,机器学习(您知道,只有最新和最伟大的技术流行语)等概念来吸引他们。

I didn’t attend more than a handful of lectures, but one of the assignments stuck with me. I had to write an essay about a famous computer scientist or academic whose work impacted computer science. I chose Noam Chomsky.

我参加的讲座不多,但其中一项任务仍然困扰着我。 我必须写一篇有关影响计算机科学的著名计算机科学家或学者的文章。 我选择了Noam Chomsky。

Little did I know that learning about Chomsky would drag me down a rabbit hole back to regular expressions, and then magically cast regular expressions into something that fascinated me. What enchanted me about regular expressions was the homonymous linguistic concept that powered them.

我几乎不知道对乔姆斯基的了解会把我拖到正则表达式的兔子洞里,然后神奇地将正则表达式转换成令我着迷的东西。 使我着迷的是正则表达式,这是同构语言概念为它们提供动力的原因。

I hope to spellbind you, too, with the linguistics behind regular expressions, a a backstory unknown to most programmers. Though I won’t teach you how to use regular expressions in any particular programming language, I hope that my linguistic introduction will inspire you to dive deeper into how regular expressions work in your programming language of choice.

我也希望通过正则表达式背后的语言将您束缚,这是大多数程序员所不知道的背景知识。 尽管我不会教您如何在任何特定的编程语言中使用正则表达式,但我希望我的语言介绍会启发您更深入地研究正则表达式在所选编程语言中的工作方式。

To begin, let’s return to Chomsky: what does he have to do with regular expressions? Hell, what does he even have to do with computer science?

首先,让我们回到乔姆斯基:他与正则表达式有什么关系? 地狱,他甚至与计算机科学有什么关系?

意外计算机科学家 (A Computer Scientist By Accident)

Wikipedia christens Noam Chomsky as a linguist, philosopher, cognitive scientist, historian, social critic, and political activist, but not as a computer scientist. Because he is so highly regarded in all of these fields, his indirect contributions to the field of computer science often fall by the wayside.

维基百科上的克里斯滕斯(Christens Noam Chomsky )是语言学家,哲学家,认知科学家,历史学家,社会评论家和政治活动家,但不是计算机科学家。 由于他在所有这些领域中都享有很高的声誉,因此他对计算机科学领域的间接贡献常常被抛在一边。

The more I researched Chomsky’s academic work, the more accidental Chomsky’s foray into computing seemed. This affirmed my belief that all fields — even those that appear disparate from computer science — have something to offer to computing and the tech industry.

我对乔姆斯基的学术工作研究得越多,乔姆斯基对计算机的尝试就越偶然。 这肯定了我的信念,即所有领域,甚至那些与计算机科学截然不同的领域,都可以为计算和技术行业提供一些东西。

His contributions to the field of linguistics in particular exemplify the impact of interdisciplinary research on computer science. The Chomsky hierarchy transformed the code that computer scientists, software engineers, and hobbyists write today.

他在语言学领域的贡献尤其体现了跨学科研究对计算机科学的影响。 乔姆斯基体系改变了当今计算机科学家,软件工程师和业余爱好者编写的代码。

Yes, it was this hierarchy that brought regular expressions to computer science. But, before we can understand the jump from Chomsky to regular expressions, I’ll outline the Chomsky hierarchy.

是的,正是这种层次结构将正则表达式带入了计算机科学。 但是,在我们理解从乔姆斯基跳到正则表达式之前,我将概述乔姆斯基层次结构。

语言法律与秩序 (Linguistic Law & Order)

The Chomsky hierarchy is an ordering of formal grammars — think syntactic rules for formal languages — such that each grammar exists as a proper subset of the grammars above it in the hierarchy. Some formal languages have stricter grammars than others, so Chomsky sought to organize formal grammars into his eponymous hierarchy.

乔姆斯基层次结构形式语法的顺序-考虑形式语言的句法规则 —这样,每个语法在层次结构中都作为其上方语法的适当子集存在。 一些形式语言的语法比其他形式语言严格,因此乔姆斯基试图将形式语法组织到他的同名体系中。

I briefly mentioned that formal grammars are syntactic rules: rules that give all possible valid phrases for a given formal language. Grammars provide the rules that build languages. In linguist-speak, a language’s formal grammar provides a framework with which nonterminals (input or intermediate string values) can be converted into terminals (output string values).

我简要地提到形式语法是句法规则:为给定形式语言提供所有可能的有效短语的规则。 语法提供了构建语言的规则。 在语言学家发言,语言的形式文法提供了一个框架与非终结符 (输入或中间字符串值)可以被转换成端子 (输出字符串值)。

To elucidate this new vocabulary, I’ll walk through an example of converting a set of nonterminals into terminals using a made-up formal grammar. Let’s say that our pretend formal language, Parseltongue, has the following formal grammar:

为了阐明这一新词汇,我将通过一个使用虚构形式语法将一组非终结符转换为终结符的示例进行介绍。 假设我们假装的形式语言Parseltongue具有以下形式语法:

  • Terminals: {s, sh, ss}

    终端:{s,sh,ss}
  • Nonterminals: {snake, I, am}

    非终结符:{蛇,我是}
  • Production rules: {I → sh, am → s, snake → ss}

    生产规则:{I→sh,am→s,snake→ss}

Using the production rules, I can convert the input sentence “I am snake” into “sh s ss.” This conversion happens piece by piece: “I am snake” → “sh am snake” → “sh s snake” → “sh s ss.”

使用生产规则,我可以将输入的句子“我是蛇”转换为“ sh s ss”。 这种转换是逐段进行的:“我是蛇”→“是蛇”→“是蛇”→“是蛇”。

As my Parseltongue example illustrates, formal grammars parse strings of nonterminals into terminal-only strings — grammatically correct phrases. But formal grammars act not only as generators of a language, but also recognizers of whether a string fits the formal grammar. Whereas the example string “I am a snake” can be fully converted into terminals, the string “I am not a snake” cannot be written in Parseltongue because the nonterminal “not” cannot be translated into a Parseltongue terminal.

如我的Parseltongue例子所示,形式语法将非终结符的字符串解析为仅终结符的字符串-语法正确的短语。 但是形式语法不仅充当语言的生成器 ,而且还充当字符串是否适合形式语法的识别器 。 示例字符串“我是蛇”可以完全转换为终端,而字符串“我不是蛇”不能用Parseltongue编写,因为非终端“ not”不能转换为Parseltongue终端。

To re-emphasize something I stated earlier: formal grammars generate formal languages. That means that, by creating a hierarchy of formal grammars, Chomsky also categorized languages themselves.

为了再次强调我之前所说的内容:形式语法生成形式语言。 这意味着,通过创建正式语法的层次结构,乔姆斯基还可以对语言本身进行分类。

With that sobering introduction, let’s look at the four formal grammars in Chomsky’s hierarchy. From most to least strict, they are:

有了醒目的介绍,让我们看一下乔姆斯基体系中的四个正式语法。 从最严格到最不严格,它们是:

  • Regular grammars, which retain no past state knowledge from input string to output string

    常规语法 ,不保留输入字符串到输出字符串的过去状态知识

  • Context-free grammars, which retain only recent state knowledge from input string to output string

    与上下文无关的语法 ,仅保留从输入字符串到输出字符串的最新状态知识

  • Context-sensitive grammars, which keep all past state knowledge from input string to output string

    上下文敏感的语法 ,保留从输入字符串到输出字符串的所有过去状态知识

  • Unrestricted (or recursively enumerable) grammars, which have all state knowledge and thus can create every output string imaginable from a given input string

    无限制 (或递归可枚举 ) 语法 ,它具有所有状态知识,因此可以从给定的输入字符串中创建可以想象得到的每个输出字符串

What is this “state knowledge” that I speak of? Think of knowledge in terms of scope. Regular grammars, for example, have no knowledge of the string’s past states in their “scope” in the process of converting an input string into an output string. This suggests that once the grammar makes an individual conversion of nonterminal to terminal (plus a series of zero or more nonterminals), the grammar “forgets” the previous state of the string.

我所说的“状态知识”是什么? 从范围上考虑知识。 例如,常规语法在将输入字符串转换为输出字符串的过程中,在其“作用域”中不了解字符串的过去状态。 这表明,一旦语法对从非终结符到终结符(加上一系列零个或多个非终结符)进行了单独的转换,该语法就会“忘记”字符串的先前状态。

On the other hand, unrestricted grammars hold onto every possible state of the string-in-translation. Context-free and context-sensitive grammars fall somewhere in the middle.

另一方面,不受限制的语法会保留翻译中字符串的每个可能状态。 无上下文和上下文敏感的语法介于中间。

If you’re looking for a more detailed explanation of the grammars in the Chomsky hierarchy, you’ll have to take a peek at automata theory. I’ll focus on the grammar that brings us back to regular expressions, fittingly called the regular grammar.

如果要在Chomsky层次结构中寻找语法的更详细说明,则必须先看一下自动机理论 。 我将重点介绍使我们回到正则表达式的语法,恰好称为正则语法。

关于正则表达式 (On the Regular Expressions)

Regular expressions and regular grammars are equivalent. They communicate the same set of syntactic rules, albeit using different formalisms, and both produce the same regular languages.

正则表达式和正则语法是等效的。 尽管使用不同的形式主义,但它们传达的是相同的句法规则,并且都产生相同的常规语言。

In linguistics, a regular expression is recursively defined as follows:

在语言学中, 正则表达式的递归定义如下:

  • The empty set is a regular expression.

    空集是一个正则表达式。
  • The empty string is a regular expression.

    空字符串是一个正则表达式。
  • For any character x in the input alphabet, x is a regular expression that produces the regular language {x}.

    对于输入字母中的任何字符x,x是产生常规语言{x}的正则表达式。
  • Alternation: If x and y are regular expressions, then x | y is a regular expression. For example, the regular expression 0|1 produces the regular language {0,1}.

    交替 :如果x和y是正则表达式,则x | y是一个正则表达式。 例如,正则表达式0|1产生正则语言{0,1}

  • Concatenation: If x and y are regular expressions, then x • y is a regular expression. For example, the regular expression 0•1 produces the regular language {01}.

    串联 :如果x和y是正则表达式,则x•y是正则表达式。 例如,正则表达式0•1产生正则语言{01}

  • Repetition (also known as Kleene star): If x and y are regular expressions, then x* is a regular expression. For example, the regular language 0•1* produces the regular language {0, 01, 011, 0111, ...}, ad infinitum.

    重复 (也称为Kleene star ):如果x和y是正则表达式,则x *是正则表达式。 例如,常规语言0•1*会无限产生常规语言{0, 01, 011, 0111, ...}

A regular grammar is composed of rules like those of Parseltongue. Just as a regular grammar can be utilized to parse an input string into an output string, a regular expression converts strings quite similarly. You can see examples of this parsing for the alternation, concatenation, and repetition operations — or, to use my prior analogy, rules — that regular expressions adopt.

规则语法由Parseltongue之类的规则组成。 正如可以使用正则语法将输入字符串解析为输出字符串一样,正则表达式也非常相似地转换字符串。 您可以看到针对正则表达式采用的交替,串联和重复操作(或使用我以前的类推规则)进行此解析的示例。

Let’s return to our friend Noam Chomsky for a moment. According to his hierarchy of grammars, regular grammars retain no information about intermediate steps in converting from an input string to an output string. What does this tell us about regular expressions?

让我们回到朋友诺姆·乔姆斯基片刻。 根据他的语法层次结构,常规语法不保留有关从输入字符串转换为输出字符串的中间步骤的信息。 这告诉我们关于正则表达式的什么?

The “forgetfulness” of regular grammars implies that translations in one part of the string do not impact how the other nonterminals in the string are translated in future steps. There is no coordination between different parts of the string in the creation of the output string.

常规语法的“健忘性”意味着字符串的一部分中的翻译不会影响字符串中其他非终结符在以后的步骤中的翻译方式。 在创建输出字符串时,字符串的不同部分之间没有协调。

Looking at the linguistics behind regular grammars gives us insight into why programmers first brought regular expressions into code. Although I’ve only discussed formal grammars as generators and recognizers of language, the fact that regular grammars convert input string to output string piece by piece makes them pattern-matchers. In programming, regular expressions use production rules to convert an input string — a pattern — into a regular language — a set of strings that match that pattern.

通过查看正则语法背后的语言学,我们可以了解程序员为何首先将正则表达式引入代码中。 尽管我仅讨论形式语法作为语言的生成器和识别器,但是常规语法将输入字符串逐段转换为输出字符串这一事实使它们成为模式匹配器 。 在编程中,正则表达式使用生产规则将输入字符串(一种模式)转换为常规语言(一组与该模式匹配的字符串)。

But I would have never written this blog post if programming language creators implemented regular expressions exactly as they are defined in the field of linguistics. Computational regular expressions are a far cry from their linguistic precursor, but the linguistic regular expressions that I covered provide a useful framework for understanding regular expressions in code.

但是,如果编程语言创建者完全按照语言学领域中的定义实施正则表达式,我将永远不会写这篇博客文章。 计算正则表达式与它们的语言先驱相去甚远,但是我所介绍的语言正则表达式为理解代码中的正则表达式提供了有用的框架。

两个正则表达式在尊严方面都相同 (Two Regular Expressions, Both Alike in Dignity)

Hereafter, I will use the term regular expression to mean a linguistic regular expression and the term regex to signify a programmatic regular expression. In the wild, both linguistic and programmatic regular expressions are referred to as “regular expressions” even though they are quite different from one another — how confusing!

在下文中,我将使用术语正则表达式来表示语言正则表达式,并使用正则表达式来表示程序化正则表达式。 在野外,语言正则表达式和程序正则表达式都被称为“正则表达式”,即使它们彼此之间有很大不同-多么令人困惑!

The difference between regular expressions and regexes stems from how they are used. Regular expressions — or regular grammars — are part of formal language theory, which exists to describe shared elements of natural languages — languages that evolved over time without human premeditation. Linguists use regular expressions for theoretical purposes, like the categorization of formal grammars in the Chomsky hierarchy. Regular expressions help linguists understand the languages that humans speak.

正则表达式和正则表达式之间的差异源于它们的使用方式。 正则表达式(即正则语法)是形式语言理论的一部分, 形式语言理论是用来描述 自然语言的共享元素的, 自然语言是随时间演变而无需人工干预的语言。 语言学家出于理论目的使用正则表达式,例如Chomsky层次结构中形式语法的分类。 正则表达式可帮助语言学家理解人类所讲的语言。

Regexes, on the other hand, are utilized by everyday programmers who want to search for strings that match a given pattern. While regular expressions are theoretical, regexes are pragmatic. Programming languages are formal languages: languages designed by people (here, programmers) for specific purposes. As you might imagine, programming language creators augmented the functionality of regexes in code. Let’s examine these enhancements.

另一方面,正则表达式供日常程序员使用,他们希望搜索 给定模式匹配的字符串。 虽然正则表达式是理论上的,但正则表达式是实用的。 编程语言是形式语言 :人们(在这里是程序员)为特定目的而设计的语言。 您可能会想到,编程语言的创建者在代码中增强了正则表达式的功能。 让我们研究这些增强功能。

Remember that regular expressions have three operations: alternation, concatenation, and repetition. I’m no regex expert — regexpert? — but all it takes is a peek at the regular expression Wikipedia page to notice that regexes implement more than just three operations.

请记住,正则表达式具有三个操作:交替,串联和重复。 我不是regex专家-regexpert? —但只需看一下正则表达式Wikipedia页面,即可注意到正则表达式不仅实现了三个操作。

For example, using POSIX regex syntax, the pattern .ork matches all four-character strings that end with the three characters “ork.” That period is more powerful than simple alternation, concatenation, and repetition, right?

例如,使用POSIX regex语法 ,模式.ork匹配所有以三个字符“ .ork所有四个字符的字符串。 那段时期比简单的交替,串联和重复更强大,对吗?

Nope. Truth be told, even the fanciest of regex metacharacters — characters that invoke a regex operation — derive from regular expression operations. Assuming that the twenty-six lowercase letters of the alphabet are the only characters in the regular grammar, the regex pattern .ork could be written using only regular expression operations as [a|b|c|...|z]ork.

不。 说实话,即使是最正则表达式元字符 (调用正则表达式操作的字符)也源自正则表达式操作。 假设字母表中的二十六个小写字母是常规语法中唯一的字符,则可以仅使用正则表达式操作作为[a|b|c|...|z]ork .ork来编写正则表达式.ork

Though the sheer volume of metacharacters suggests that regex has a more powerful set of operations than regular expressions themselves, metacharacters are merely shortcuts for various permutations of the operations that define regular expressions. Regex metacharacters provide a programmer-friendly abstraction for common combinations of alternation, concatenation, and repetition.

尽管大量的元字符表明正则表达式比正则表达式本身具有更强大的操作集,但是元字符仅仅是定义正则表达式的各种操作排列的快捷方式。 正则表达式元字符为交替,串联和重复的常见组合提供了程序员友好的抽象。

So far, I’ve portrayed regexes as regular expressions with amazing shortcuts and clear-cut use cases. However, as you may recall from Chomsky’s hierarchy, regular grammars have the strictest rules and no scope. Luckily, regexes have a little more leeway than their linguistic precursor, thereby bestowing them with more practical power.

到目前为止,我已经将正则表达式描绘为具有惊人的快捷方式和明确用例的正则表达式。 但是,您可能还记得乔姆斯基的层次结构,规则语法具有最严格的规则,没有范围。 幸运的是,正则表达式比其语言的前身有更多的回旋余地,从而赋予它们更多的实践能力。

打破常规语法规则 (Breaking the Regular Grammar Rules)

Recall that, according to the the Chomsky hierarchy, regular grammars retain no knowledge in converting an input string to an output string. Since regular expressions are equivalent to regular grammars, this means that regular expressions also have no memory of the intermediate states of a string as it changed from input to output. It also means that translating a nonterminal in one part of a regular expressions has no bearing on the translation of a nonterminal in another part of the expression.

回想一下,根据Chomsky层次结构,常规语法在将输入字符串转换为输出字符串方面毫无保留。 由于正则表达式等价于正则语法,因此这意味着当字符串从输入变为输出时,正则表达式也不存储字符串的中间状态。 这也意味着在正则表达式的一部分中翻译非末端与在表达式的另一部分中翻译非末端无关。

For regexes, it’s a different story. Regexes violate this key regular grammar characteristic by supporting the ability to backreference. Backreferencing allows the programmer to parenthetically separate a subsection of a regular expression and refer to it using a metacharacter. To give an example, the pattern (la)\1 matches “lala” by employing the \1 metacharacter to repeat the search for “la.”

对于正则表达式,这是一个不同的故事。 正则表达式通过支持反向引用功能而违反了此关键的常规语法特征。 反向引用允许程序员在括号中分隔正则表达式的子节,并使用元字符对其进行引用。 例如,模式(la)\1通过使用\1元字符重复搜索“ la”来匹配“ lala”。

Because different parts of the string cannot influence one another in regular expressions, backreferencing gives regexes a lot more power than their predecessor. More importantly, backreferencing facilitates practical uses of regex such as searching for typos in which the same word was accidentally typed twice in a row. Pragmatism gives insight into why regular expressions were tweaked to create regexes in programming.

由于字符串的不同部分不能在正则表达式中相互影响,因此反向引用使正则表达式比其前任具有更大的功能。 更重要的是,反向引用促进了正则表达式的实际使用,例如搜索拼写错误,在该拼写错误中,同一单词被连续两次意外键入。 实用主义深入探讨了为什么要对正则表达式进行调整以在编程中创建正则表达式。

Another feature that increases the functionality of regex is the ability to alter the greediness of the matching. Different quantifiers — categories of regex patterns — can look similar but match drastically different parts of a string. A greedy quantifier (*) will attempt to match as much of the string as possible, whereas a reluctant quantifier (?) will try to match the minimum amount of characters in the string. Given the string “abcorgi,” the pattern .*corgi would match the entire string but the pattern .?corgi would only match “bcorgi.”

增加正则表达式功能的另一个功能是更改匹配贪婪性的能力。 不同的量词 -正则表达式模式的类别-看起来可能相似,但匹配字符串的截然不同的部分。 贪婪的量词 (*)将尝试匹配尽可能多的字符串,而勉强的量词 (?)将尝试匹配字符串中最少的字符。 给定字符串“ abcorgi”,模式.*corgi将匹配整个字符串,但是模式.?corgi将仅匹配“ bcorgi”。

A possessive quantifier (+) also attempts to match as much of the string as possible, but, unlike the greedy quantifier, it will not backtrack to previous characters in the string in order to find the largest possible match. Given the string “abcorgi,” the patterns .*corgi and .+corgi would match the entire string. Though possessive and greedy qualifiers will often produce the same result, possessive qualifiers tend to be more efficient because they avoid backtracking.

所有格修饰符 (+)还会尝试匹配尽可能多的字符串,但与贪婪的限定符不同,它不会回溯到字符串中的先前字符以找到最大的匹配项。 给定字符串“ abcorgi”, .*corgi.+corgi将匹配整个字符串。 尽管所有格和贪婪限定词通常会产生相同的结果,但所有格限定词往往会更有效,因为它们避免了回溯。

Because quantifiers are metacharacters, they can technically be built from alternation, concatenation, and repetition: the three operations of regular expressions. However, quantifiers create a simple abstraction that allows programmers to quickly specify what type of match they would like.

由于量词是元字符,因此从技术上讲,它们可以由交替,串联和重复构建:正则表达式的三个操作。 但是,量词创建了一个简单的抽象,使程序员可以快速指定所需的匹配类型。

结论和进一步阅读 (Conclusion & Further Reading)

What a journey we’ve undertaken! We learned about Chomsky and his eponymous hierarchy, then dove deeper into regular grammars. From regular grammars, we explored the linguistic definition of a regular expression. Finally, we used the differences between regular expressions and regexes to motivate how programmers use regex today.

我们进行了多么漫长的旅程! 我们了解了乔姆斯基及其同名体系,然后更深入地研究了常规语法。 从正则语法中,我们探索了正则表达式的语言定义。 最后,我们利用正则表达式和正则表达式之间的差异来激发程序员今天如何使用正则表达式。

Although I trace the history of regular expressions from Chomsky to modern programming languages, this blog post is not the end of the regex story. If you’d like to learn more about linguistic and computational regular expressions, I have some motivating questions for you.

尽管我追踪了从Chomsky到现代编程语言的正则表达式的历史,但该博文并不是regex故事的结尾。 如果您想了解有关语言和计算正则表达式的更多信息,我为您提供了一些启发性的问题。

  • What is automata theory and how does it relate to the Chomsky hierarchy?

    什么是自动机理论,它与Chomsky层次结构有何关系?
  • How are regex implemented? What are the tradeoffs of various regex algorithms?

    正则表达式如何实施? 各种正则表达式算法的权衡是什么?
  • When is it appropriate to use regexes instead of built-in string match and manipulation libraries?

    什么时候适合使用正则表达式而不是内置的字符串匹配和操作库?

I also have a list of resources that I used to study up on the linguistic and computational elements of regular expressions. Happy regex-ing!

我还列出了一些资源,用于研究正则表达式的语言和计算元素。 regex-ing很高兴!

Enjoy what you read? Spread the love by liking and sharing this piece. Have thoughts or questions? Reach out to me on Twitter or in the comments below. Thank you Miles Hinson for proofreading this piece!

享受阅读的内容吗? 通过分享和分享这段爱情来传播爱。 有想法或问题吗? Twitter或以下评论中与我联系。 感谢Miles Hinson对本文进行校对!

翻译自: https://www.freecodecamp.org/news/exploring-the-linguistics-behind-regular-expressions-596fab41146/

正则语言和正则表达式

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值