in reply to Re: Spaces Between Chars While Reading File
in thread Spaces Between Chars While Reading File

Using ".+" in a regular expression is generally going to lead to trouble.

Why is that (generally)? — I mean, it all depends on what you want to achieve, doesn't it?

  • Comment on Re^2: Spaces Between Chars While Reading File

Replies are listed 'Best First'.
Re^3: Spaces Between Chars While Reading File
by massa (Hermit) on Aug 01, 2008 at 14:35 UTC
    "Greedily garble everything" is rarely what you want to achieve. In the OP case, it will change
    "ab", "abc", "cde"
    into
    ab", "abc", "cde
    which is (possibly) not the intended result. The ideal would be
    s/"([^"]+)"/$1/g
    that would yield
    ab, abc, cde
    []s, HTH, Massa (κς,πμ,πλ)