RE: Re: Matching last comma (not last character)

2002-04-11 Thread Nikola Janceski
[EMAIL PROTECTED]] > Sent: Thursday, April 11, 2002 1:40 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: Re: Matching last comma (not last character) > > > On , [EMAIL PROTECTED] said: > > >I used the regex in the end, the list will only ever be a > few

Re: Re: Matching last comma (not last character)

2002-04-11 Thread Jeff 'japhy' Pinyan
On , [EMAIL PROTECTED] said: >I used the regex in the end, the list will only ever be a few elements >long (and the script doesn't need to be efficient). Can't say I >understand it completely though (I was with you up until the first >comma) :) Ok, here's an explanation: >> s/,(?=[^,]*$)/, or/

Re: Re: Matching last comma (not last character)

2002-04-11 Thread p
Thanks, it works great. I used the regex in the end, the list will only ever be a few elements long (and the script doesn't need to be efficient). Can't say I understand it completely though (I was with you up until the first comma) :) Apologies for my mail client. It's a web-based dohickey th

RE: Matching last comma (not last character)

2002-04-11 Thread Nikola Janceski
here is your substitution.. (haven't tested it but should work). s/,([^,]*)$/, or$1/; > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: None > To: [EMAIL PROTECTED] > Subject: Matching last comma (not last character) > > > Hi, > > I've got a comma sepa

Re: Matching last comma (not last character)

2002-04-11 Thread Jeff 'japhy' Pinyan
[What mail client are you using? It refuses to include a Date: header] On , [EMAIL PROTECTED] said: >apples, oranges, pears > >I'd like to make it reads: > >apples, oranges, or pears No need to use a regex, especially since a regex will have to go through the whole string. # if there is a c