Lines Matching +full:sub +full:- +full:groups
2 # SPDX-License-Identifier: GPL-2.0
8 Those help caching regular expressions and do matching for kernel-doc.
22 regular expressions and define sub at class init time.
30 Adds a new regex or re-use it from the cache.
92 def sub(self, sub, string, count=0):
94 Alias to re.sub
97 return self.regex.sub(sub, string, count=count)
124 https://stackoverflow.com/questions/5454322/python-how-to-match-nested-parentheses-with-regex
126 Although I re-implemented it to make it more generic and match 3 types
131 # TODO: make NestedMatch handle multiple match groups
145 # match groups, allowing a regex equivalent to.
167 https://stackoverflow.com/questions/5454322/python-how-to-match-nested-parentheses-with-regex
177 This should be OK for kernel-doc parser, as unaligned delimiters
188 d = line[offset - 1]
207 if stack and d == stack[-1]:
226 def sub(self, regex, sub, line, count=0):
228 This is similar to re.sub:
248 value = line[end:pos - 1]
250 # replaces \1 at the sub string, if \1 is used there
251 new_sub = sub