Link Details

Link 120930 thumbnail
User 225256 avatar

By mswatcher
via codeproject.com
Published: Sep 30 2008 / 14:58

Regular expressions are notorious for being confusing to read and understand. The longer the regular expression, the higher the chance of making a mistake in it, and the more difficult it is to debug or modify. Of course, every regular expression would be commented thoroughly. It would still suffer from being a single long line of characters.
  • 13
  • 1
  • 1107
  • 442

Comments

Add your comment
User 256617 avatar

dragmire replied ago:

0 votes Vote down Vote up Reply

I understand the objection, but I think the point of regular expressions is to be succinct and compatible. Otherwise, why not just write a regular replace?

Experience with regular expressions usually leads to the ability to decipher the gobbledygook rather quickly, as you would with any other language. This approach actually makes it a bit tougher to maintain for those that do understand the expressions.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.