Quickie - Regexp for a string not at the beginning of the line
schesis at gmail.com
Thu Oct 25 23:21:32 CEST 2012
On 25 October 2012 16:53, Rivka Miller <rivkaumiller at gmail.com> wrote:
> I am looking for a regexp for a string not at the beginning of the
There are probably quite a few ways to do this, but '(?<!^)PATTERN'
has the advantage of explicitly describing what you're trying to do.
>>> pattern = re.compile(r"(?<!^)\b\w+\b")
>>> re.findall(pattern, "this is some text")
['is', 'some', 'text']
More information about the Python-list