[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Including ' in a sed command



On Fri, 8 Aug 2025, Tim Woodall wrote:

I didn't mention it but this hits the same snag as "[\"']", the real expression is much more complex, approximately:

s/.*\$ref["']\{0,1\}: *["']\([^"']*\)["'].*/\1/

which gets messy with \\\$ etc malarky without the single quotes.


Hmmm, actually, this is wrong. I was getting confused with matching a trailing $ which is the case where "\\\$" and '\$' matters.

Maybe switching to " will be best.


Reply to: