Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

In Ruby:

    %w[fatal invalid unknown error except critical cannot].any? {|word| 'My critical error message'.include? word}
... may be better than a regex if it's just a list of literal strings. Javascript also has something similar.


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

Search: