What are extended regular expressions?

I am studying an exam and one of the topics is about RegEx. There is a modifier xin which the description uses extended regular expressions, but this does not explain what it means. I cannot find anything on Google that matches the context of my study material.

In the quiz, one of the questions asked which modifier allows using comments in RegEx, but there was a correct (?) Answer x.

Can someone help me figure this out? Thank.

Edit: I meant xin the context [gix],where it xdescribes how to "use extended regular expressions."

+4
source share
4

perlretut ( /x):

, , , . , , //x . , . ,

    /^
          [+-]?         # first, match an optional sign
          (             # then match integers or f.p. mantissas:
               \d+\.\d+  # mantissa of the form a.b
              |\d+\.     # mantissa of the form a.
              |\.\d+     # mantissa of the form .b
              |\d+       # integer of the form a
          )
          ([eE][+-]?\d+)?  # finally, optionally match an exponent
      $/x;
+7

perlre:

/x , , . , () ...

.

 /^            # the beginning of the string
   (?:         # group, but do not capture:
       foo     #   match 'foo'
      |        #  OR
       bar     #   match 'bar'
   )           # end of grouping
  $            # the end of the string
 /x;

/x .

/foo(?# match foo)/
+4

/x , , .

+2

, , .

/x (m//) (s///) Perl , . , .

Perl, ( look-ahead look-behind), .

0

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


All Articles