Why can't Regular Expressions use keywords instead of characters?

后端 未结 14 3148
甜味超标
甜味超标 2021-02-20 06:46

Okay, I barely understand RegEx basics, but why couldn\'t they design it to use keywords (like SQL) instead of some cryptic wildcard characters and symbols?

Is it for pe

14条回答
  •  面向向阳花
    2021-02-20 07:15

    Actually, no, the world did not begin with Unix. If you read the Wikipedia article, you'll see that

    In the 1950s, mathematician Stephen Cole Kleene described these models using his mathematical notation called regular sets. The SNOBOL language was an early implementation of pattern matching, but not identical to regular expressions. Ken Thompson built Kleene's notation into the editor QED as a means to match patterns in text files. He later added this capability to the Unix editor ed, which eventually led to the popular search tool grep's use of regular expressions

提交回复
热议问题