Hi,
I'll post a simplified version of my problem. Basically, I want to
substitute every occurrence of 'a' (the letter a, without the quotes) with
'b', but only if 'a' is not inside a string, by which I mean it is not
enclosed in double quotes.
So, for the line:
1234 a a "a" a
I'd like to get:
ivan budiselic wrote:
> Hi,
>
> I'll post a simplified version of my problem. Basically, I want to
> substitute every occurrence of 'a' (the letter a, without the quotes) with
> 'b', but only if 'a' is not inside a string, by which I mean it is not
> enclosed in double quotes.
>
> So, for the li
On Mon, Mar 30, at 03:00 ivan budiselic wrote:
> Hi,
>
> I'll post a simplified version of my problem. Basically, I want to
> substitute every occurrence of 'a' (the letter a, without the quotes) with
> 'b', but only if 'a' is not inside a string, by which I mean it is not
> enclosed in double qu
On Mon, Mar 30, 2009 at 5:07 PM, Andreas Bernauer wrote:
>
> ivan budiselic wrote:
> > Hi,
> >
> > I'll post a simplified version of my problem. Basically, I want to
> > substitute every occurrence of 'a' (the letter a, without the quotes)
> with
> > 'b', but only if 'a' is not inside a string, by
ivan budiselic wrote:
>>> So, for the line:
>>>
>>> 1234 a a "a" a
>>>
>>> I'd like to get:
>>>
>>> 1234 b b "a" b
>>>
>>> The question is, is this possible and how.
>>>
>>> What I've tried is
>>> let line = substitute(line, '\([^\"]\{-}\)a', "\\1b", "g")
>>
>> ...because \{-} matches also 0 times
On Tue, Mar 31, 2009 at 10:13 AM, Andreas Bernauer wrote:
>
> ivan budiselic wrote:
> >>> So, for the line:
> >>>
> >>> 1234 a a "a" a
> >>>
> >>> I'd like to get:
> >>>
> >>> 1234 b b "a" b
> >>>
> >>> The question is, is this possible and how.
> >>>
> >>> What I've tried is
> >>> let line = subs
2009/3/31 ivan budiselic :
> On Tue, Mar 31, 2009 at 10:13 AM, Andreas Bernauer
> wrote:
>>
>> ivan budiselic wrote:
>> >>> So, for the line:
>> >>>
>> >>> 1234 a a "a" a
>> >>>
>> >>> I'd like to get:
>> >>>
>> >>> 1234 b b "a" b
>> >>>
>> >>> The question is, is this possible and how.
>> >>>
>>
On Tue, Mar 31, 2009 at 4:40 PM, A. S. Budden wrote:
>
> 2009/3/31 ivan budiselic :
> > On Tue, Mar 31, 2009 at 10:13 AM, Andreas Bernauer
> > wrote:
> >>
> >> ivan budiselic wrote:
> >> >>> So, for the line:
> >> >>>
> >> >>> 1234 a a "a" a
> >> >>>
> >> >>> I'd like to get:
> >> >>>
> >> >>> 1