POV-Ray : Newsgroups : povray.off-topic : Other people dislike regexes too : Re: Other people dislike regexes too Server Time
29 Jul 2024 02:26:19 EDT (-0400)
  Re: Other people dislike regexes too  
From: Invisible
Date: 16 Jul 2012 09:26:39
Message: <5004168f@news.povray.org>
On 16/07/2012 12:48 PM, Warp wrote:
> You can argue against regexes by giving examples of really long and
> complicated patterns, but then you would be complaining about extreme
> fringe cases, not about *the most common* usage for them, for which they
> are just superb.

In my limited experience, people don't use regexes for simple pattern 
matches. They only use them for insanely complex cases - cases where it 
would be far, far better to spell out exactly what you're trying to do, 
rather than encode it into a tangle of punctuation.

I can see how if you're just trying to quickly search some document for 
a piece of information, being able to throw together a short text string 
and get nearly the right results might be useful. And hey, if you're 
only doing this once, who /cares/ that it's completely non-maintainable. 
It's a one-off task; you don't /need/ to maintain anything.

But for building large, complex applications, regexes seem like a 
stupendously bad idea.

Also, the usual formulation of regexes as text strings means that you 
can only match against text strings. Admittedly that's the most common 
case for wanting to do complicated matching. But if, say, you wanted to 
match against a binary file... sorry, you can't do that. As far as I can 
tell, there's no reason why a formal regular expression can't be matched 
against binary data; it's just that most real-world implementations 
don't allow this.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.