Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

well, if you are strictly interested in matching with the fewest characters, regardless of the apparent pattern:

  ^(.)(.).*\2\1$


Your anchors at the end make it match nothing.


sorry, misreplied. This was for palindromes.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: