in reply to Re: Quick Regex question
in thread Quick Regex question

I'll post a nice verbose post to elucidate this for everyone not involved in the chatterbox:

You wanted to replace all non-word characters with spaces. The pattern you listed wasn't working.

The problem was that you didn't use the /g modifier, so it only replaced the first matching expression.

Replies are listed 'Best First'.
Re: Re: Re: Quick Regex question
by chromatic (Archbishop) on Nov 18, 2000 at 08:36 UTC
    In that case, I wouldn't use s/// at all. tr/// is faster and fits better, conceptually.

    tr/a-zA-Z0-9/ /c;

    I really like that /compliment switch.