in reply to stripping

I'm not suggesting this approach is best but if the line looks exactly like that (or reasonably close) and none of the other lines do you might try something more specific than the other suggestions you've received. Maybe:

$text =~ s/(\$url\s*=\s*")\((.*?)\)/$1$2/;
-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: stripping
by queue (Beadle) on Jan 04, 2003 at 16:59 UTC
    Or how about just:

    $text =~ s/"\((.*?)\)"/"$1"/;

    Or even:

    $text =~ s/(?<")\((.*?)\)(?=")/$1/;

    Okay, so you probably don't really want to use the second one.

    Queue
    slowly working his way through Mastering Regular Expressions
      Or how about just:

      According to the original post, there were "a couple lines earlier in the script that also have a parantheses." What if one of them looked like this

      my @parens = ("(", ")");
      for instance?

      It's best to say exactly what you really mean with regular expressions.

      -sauoq
      "My two cents aren't worth a dime.";
      
        If he knows that the only other parentheses he is going to have in his data are not going to have quotes before or after them, is it more efficient to try to match less? Or is that not an issue?

        Queue
        has much to learn