Python: re (regexp): index of matches: difference between findall and finditer

using the findall method of a regexp will return all matches to the regular experession as a list using finditer will return an iterator which you can use to interate through the matches if m is the result of iterator.next() then m.span() will give you the start and end indexes of the match and m.group()… Read More Python: re (regexp): index of matches: difference between findall and finditer

Python: using a regexp to do pattern matching on a byte stream

Python regular expressions are a very concise and efficient way of performing pattern matching on strings. Many computing problems involves a similar kind of pattern matching, but on arbitrary data. For my particular application I have a long sequence of one byte digital codes that indicate a sequence of runs for an experiment. Each run… Read More Python: using a regexp to do pattern matching on a byte stream