如何匹配没有数字的行的正则表达式?

Hab*_*ibS 2 regex

我有多行文字,并且只想匹配没有数字的行:

text without numbers
text 1 with number

some other text
text without numbers
text 1 with number


text without numbers
text 1 with number
Run Code Online (Sandbox Code Playgroud)

我运气不好.任何建议表示赞赏.

Ast*_*isk 8

^[^\d]*$
Run Code Online (Sandbox Code Playgroud)

选择任何数字除外.


Joe*_*oey 5

你可以断言整行只包含非数字:

^\D*$
Run Code Online (Sandbox Code Playgroud)

\D是字符类的简写[^0-9](在当前的发动机有望更接近[^\d]\d被识别Unicode的,但我离题...)相匹配的一切,但数字.