All Questions
3 questions
1
vote
1
answer
59
views
regex to grab only one c-style multi-line comment immediately above a function
I'm trying to grab the multi-line comment in some c code that is above an arbitrary function using a regular expression. ONLY the comment immediately above the function and the function code itself is ...
3
votes
2
answers
1k
views
Don’t understand lazy regex
Say we have a string 1abcd1efg1hjk1lmn1 and want to find stuff between 1-s. What we do is
re.findall('1.*?1','1abcd1efg1hjk1lmn1')
and get two results
['1abcd1', '1hjk1']
ok I get that. But if we do
...
2
votes
2
answers
177
views
Is there any streaming regular-expression module for Python?
I'm looking for a way to run a regex over a (long) iterable of "characters" in Python. (Python doesn't actually have characters, so it's actually an iterable of one-length strings. But same difference....