Hacker News new | past | comments | ask | show | jobs | submit login

Can't quite get this to work in vim [1]:

  \(^1\{-,1}$\)\|\(^\(11\+\)\1\+$\)
The two parts match what you'd expect on their own but the OR-ing screws it up: it means the whole regex matches everything.

Is this something vim gets right and every other engine wrong, the other way around, or...?

_____________

[1] I'm matching 1's rather than dots to avoid highlighting every bit of text ever anywhere all the time.

Also, that way it's so much more pleasing to the eye and easy to read, don't you think?




> Also, that way it's so much more pleasing to the eye and easy to read, don't you think?

No, it's harder to read. For ease of reading, you need to match something that isn't already part of the expression, like 2s or Ks.


>> No, it's harder to read.

Don't worry, I had my humour removed at birth also. It grows back, eventually.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: