DEV Community

Discussion on: How do you feel about regex?

Collapse
 
mbarzeev profile image
Matti Bar-Zeev

You write a regex and don't write a comment next to it describing what it does, you and I gonna have a lil' chat ;)

Collapse
 
waylonwalker profile image
Waylon Walker

I recently had a case where the person I was reviewing added regex, and they did comment what it did well, and honestly the comment looked exactly correct. They were missing tests, and it wasn't until they ran tests that they realized that what they had done was not what they described in the comment.

Collapse
 
mbarzeev profile image
Matti Bar-Zeev

Hey, tests go without saying, right?
;)

Collapse
 
zakwillis profile image
zakwillis

As long as it can be tested proven, and injectable (i.e. not hard coded) should be fine? :)