in reply to Re: Smart Substrings
in thread Smart Substrings

LOL :)

"Remember, just say NO to regex (when simpler functions will do)". - MeowChow

sorry, couldn't resist it :)

cLive ;-)

Replies are listed 'Best First'.
Re: Re: Smart Substrings
by MeowChow (Vicar) on Apr 03, 2001 at 09:21 UTC
    I knew this would be coming...

    Yes, I did resort to a regex, but only because of two exceptional cases (extra spaces and tabs). Not knowing the poster's requirements in this regard, I wrote something that would handle these cases. The non-regex solution is still a much better fit to this problem, and the regex that I did use was kept fairly simple. It would even have been /\w\s\/, but I chose to simplify the indexing arithmetic instead.

    Hmm... all this backtracking, I'm beginning to sound like a regex myself :)

       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print