I`m a beginner of Regex. When I was trying to select lines starting with a nondigit character in this test file,
1 2012-01-01 12:00:00
2 2013-01-01 13:00:00
3 2012asdas
4 asdasasad
I tried
/^\D
and got what I want:
1 2012-01-01 12:00:00
2 2013-01-01 13:00:00
3 2012asdas
4 **a**sdasasad
Then, I was curious about if I could do the same job with /^[^\d]
, but it just matched all the lines:
1 **2**012-01-01 12:00:00
2 **2**013-01-01 13:00:00
3 **2**012asdas
4 **a**sdasasad
I then tried /^[^\w]
and got the same result.
Thus, I`m thinking which part of the regex is wrong. The question might be trivial, but any feedback is appreciated.