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

For Abba...

Why doesn't (.)(.)\2[^\1] work?

I thought backreferences matched the captured literal, so negating it would match? But this looks the same as (.)(.)\2\1...




You cannot negate a capture, only a character literal. A capture might only be a character but it is NOT a literal,


Gotcha. That makes perfect sense. Thank you! :)


You got it :-)


(.)(.)\2\1 ?




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

Search: