On Apr 12, 4:29 am, Andreas <a.pfren...@gmail.com> wrote:
> Hello,
>
> I'd like to create a regex that captures any unicode character, but
> not the underscore and the digits 0-9.

[requirement 1]

> "^(?u)\w$" captures them also.
> Is there a possibility to restrict an expression like "\w" to "\w
> without [0-9_]"?

[requirement 2]

The two requirements are not the same.
R1: [^0-9_] matches any character except the underscore and the digits
0-9
R2: To match "like \w except for underscore and digits 0-9", find
"negative lookbehind assertion" in the re docs.

I've omitted the ^, $ and (?u) because the above advice is general.

HTH,
John
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to