The value of match in relation to regular expressions

I write term paper on regular expressions, and I'm a little confused about how the word "match" is used when referring to regular expressions. Which of the following is the correct wording:

  • "Regular expression matches string"

or

  • "String matches regex

Or are they both correct? All opinions on this subject are welcome! I really want to get this right, and I think that it will help my understanding to understand this.

+3
source share
11 answers

, . , . , , , . , , , . , , .

+9

, ,

+3

, ( , ) , .

, , .

: Focus .

: Focus regex.

+3

. , . .

+2

, , . , , , - .

+1

, ( ) . , : , , .

0

" "
, RE (, ^ $ , ). , : match (es) .

" "
, true, , .
, .

0

, , , .

, , ( , , ), .

, , RE - . - : -)

0

" " ", , ."

" " " , , ."

0

:

/ , .

, .

( , .)

0

Since a regular expression represents a possibly infinite set of leaf strings, I would say that it is most correct to write that "string s matches regular expression r". You can also say that "string s is a member of the set generated by the regular expression r".

In addition, you should consider using the words accept and reject, especially if you intend to discuss state machines in your article.

0
source

Source: https://habr.com/ru/post/1703252/


All Articles