![](/img/trans.png)
[英]Regular Expression to match all non alphanumeric characters except “<--”
[英]How to match all alphanumeric except underscore on Python
我一直在嘗試與正則表達式匹配所有字母數字字符,除了下划線。 我目前正在使用r"^[a-zA-Z0-9]*"
,但我想知道是否可以使用\\w
並排除_
。
謝謝!
是的,就像那樣: [^\\W_]
\\W
與\\w
相反
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.