Re: Find Strings (Tokens) in File and push them into an array - How? [message #169574 is a reply to message #169566] |
Sat, 18 September 2010 09:17 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma:
|
Senior Member |
|
|
.oO(aaaa)
>>> Regular expressions are slow.
>>
>> Not necessarily. And in most cases their flexibility and powerfulness
>> far outweigh their performance issue.
>
> In most cases their debugging takes more time.
> Plus their are plain evil.
> It's like programmers use functions, objects, coding standards and comments
> that make their code in many cases longer, but easier to understand and
> read. Regular expressions are exacly the opposite- hard to read, understand
> and debug. Using regular expressions is like writting obscure code.
Obviously you haven't really understood what they are and when pattern
matching is the most appropriate tool. Of course you can completely
avoid them, but there are enough cases where a replacement for a single-
line regex would be many dozen lines of string manipulation functions.
_That_ would be hard to debug and understand.
Yes, regexps are much easier to write than to read, but that doesn't
make them less useful. You just need a good understanding of how they
work internally.
Micha
|
|
|