Regexp for a string not at the beginning of the line
Zero Piraeus
schesis at gmail.com
Thu Oct 25 17:21:32 EDT 2012
More information about the Python-list mailing list
Thu Oct 25 17:21:32 EDT 2012
- Previous message (by thread): Quickie - Regexp for a string not at the beginning of the line
- Next message (by thread): Quickie - Regexp for a string not at the beginning of the line
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
: 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 > line. There are probably quite a few ways to do this, but '(?<!^)PATTERN' has the advantage of explicitly describing what you're trying to do. For instance: >>> pattern = re.compile(r"(?<!^)\b\w+\b") >>> re.findall(pattern, "this is some text") ['is', 'some', 'text'] -[]z.
- Previous message (by thread): Quickie - Regexp for a string not at the beginning of the line
- Next message (by thread): Quickie - Regexp for a string not at the beginning of the line
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list