LINUX.ORG.RU

Ответ на: комментарий от suzuki

Работает, cпасибо.

Подстрока, совпавшая с регекспом их круглых скобок сохраняется в
массиве к которому потом можно обратиться по индексу, так?

Frakhtan-teh ★★
() автор топика
Ответ на: комментарий от Frakhtan-teh

Вроде того.

`\(REGEXP\)'
     Groups the inner REGEXP as a whole, this is used to:

        * Apply postfix operators, like `\(abcd\)*': this will search
          for zero or more whole sequences of `abcd', while `abcd*'
          would search for `abc' followed by zero or more occurrences
          of `d'.  Note that support for `\(abcd\)*' is required by
          POSIX 1003.1-2001, but many non-GNU implementations do not
          support it and hence it is not universally portable.

        * Use back references (see below).


`\DIGIT'
     Matches the DIGIT-th `\(...\)' parenthesized subexpression in the
     regular expression.  This is called a "back reference".
     Subexpressions are implicity numbered by counting occurrences of
     `\(' left-to-right.

suzuki
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.