我已经学习 ksh 很长一段时间了,但我仍然无法%(pattern-pair(s))
在手册中理解。任何人都可以举一个简单有意义的例子吗?
A pattern of the form %(pattern-pair(s)) is a sub-pattern that can be
used to match nested character expressions. Each pattern-pair is a two
character sequence which cannot contain & or |. The first pattern-pair
specifies the starting and ending characters for the match. Each sub-
sequent pattern-pair represents the beginning and ending characters of
a nested group that will be skipped over when counting starting and
ending character matches. The behavior is unspecified when the first
character of a pattern-pair is alpha-numeric except for the following:
D Causes the ending character to terminate the search for
this pattern without finding a match.
E Causes the ending character to be interpreted as an
escape character.
L Causes the ending character to be interpreted as a quote
character causing all characters to be ignored when look-
ing for a match.
Q Causes the ending character to be interpreted as a quote
character causing all characters other than any escape
character to be ignored when looking for a match.