loading...

re: Do we need Regex? VIEW POST

FULL DISCUSSION
 

Oh, I love a good regex fight! :-)

The great thing about regex is that they are a powerful DSL which exist inside many command line tools (e.g., grep, sed, etc) across multiple platforms and also available in most programming languages.

The terrible thing about regex is that it can be a particularly terse DSL with no single reference implementation, making readability and portability difficult.

I've become more comfortable with using regex both from the command line and inside languages over the years I've been a developer, but I have certainly shot myself in the foot many times trying to debug my own expressions. I'm much happier to use regex when scripting on the command line because I'm far less comfortable writing shell scripts to avoid using regex.

Ultimately, regex is a very powerful tool and each person should come to their own level of comfort with when and how they should be used. When working within a team, this should be a conversation/agreement at team level.

 

Thanks for sharing! I agree with you about using Regex in the command line also. that's right. Another thing about implementation.

Sometimes, when I use Javascript and Java or C#. I use the same regex pattern but the result isn't the same. :*( I hope this is the terrible thing like you mention

The terrible thing about regex is that it can be a particularly terse DSL with no single reference implementation,

code of conduct - report abuse