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

This (ruby) regex thing still gives me a headache , esp when I'm trying to figure out other people's code


You can also use this as String#slice, which is a little clearer:

    "foo@example.com".slice(/@(.*)/, 1)


I love regex, but man it's still crazy voodoo. I hope those lines were well commented.




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

Search: