Re: regEx to remove spaces

2006-05-19 Thread John Craig
Here's a small snippet that will replace spaces within quotes using regex's. Just put your data into tString and the new data is put into tResult. repeat while matchText(tString, ([ quote ][^ quote ]+[ quote ]), tMatch) put replaceText(tMatch, , ) into tReplacement put

Re: regEx to remove spaces ?

2006-05-19 Thread John Craig
Apologies - sent the wrong snippet earlier. The correct version (very similar) is; Here's a small snippet that will replace spaces within quotes using regex's. Just put your data into tString and the new data is put into tResult. put tString into tResult repeat while matchText(tString, ([

Re: regEx to remove spaces ?

2006-05-19 Thread Sivakatirswami
On May 16, 2006, at 11:45 PM, jbv wrote: Hi list, Is it possible to use regEx to remove spaces before and after quotes, and, if yes, how ? Example : my beautiful laundrette becomes my beautiful laundrette I'm curious what mandates regEx? if the means is not an issue in reaching

Re: regEx to remove spaces ?

2006-05-19 Thread jbv
Hi, thanks for the response, but I don't think it would work... let's go back to my example : my beautiful laundrette if you replace tOpenSpace first, then you get : my beautiful laundrette and then if you replace tCloseSpace, you get mybeautifullaundrette Thanks anyway, JB

Re: regEx to remove spaces ?

2006-05-19 Thread Martin Baxter
# How about: put my quote beautiful quote laundrette into srctext put into repchar put 0 into oldoff put 1 into toff repeat while toff 0 put offset(quote,srctext,oldoff) into toff if toff 0 then put repchar into char oldoff + toff of srctext add toff to oldoff if repchar = then

Re: regEx to remove spaces ?

2006-05-19 Thread Dar Scott
On May 17, 2006, at 3:45 AM, jbv wrote: Is it possible to use regEx to remove spaces before and after quotes, and, if yes, how ? Example : my beautiful laundrette becomes my beautiful laundrette (?x) (?=) \ + (?= [^]* (?(?:[^]*){2})* [^]* \z

Re: regEx to remove spaces ?

2006-05-18 Thread Mark Schonewille
Hi Alex, You're right about the additional assumptions, although one might call the function within another repeat loop for each line, if each pair of quotes is in one single line. As other solutions have shown, one may also replace the return with a unique string before calling this

Re: regEx to remove spaces ?

2006-05-18 Thread jbv
many thanks to all list members who responded to my question. actually I had already cooked my own script (see below - not really elegant, but efficient fast enough for what I need to do). I was just wondering if it could be done in a simpler way with a regEx... Best, JB put into myL put

regEx to remove spaces ?

2006-05-17 Thread jbv
Hi list, Is it possible to use regEx to remove spaces before and after quotes, and, if yes, how ? Example : my beautiful laundrette becomes my beautiful laundrette Thanks, JB ___ use-revolution mailing list use-revolution@lists.runrev.com

Re: regEx to remove spaces ?

2006-05-17 Thread Mark Smith
, jbv wrote: Hi list, Is it possible to use regEx to remove spaces before and after quotes, and, if yes, how ? Example : my beautiful laundrette becomes my beautiful laundrette Thanks, JB ___ use-revolution mailing list use-revolution

Re: regEx to remove spaces ?

2006-05-17 Thread Mark Schonewille
store on-line: http:// www.salery.biz/salery.html Op 17-mei-2006, om 11:45 heeft jbv het volgende geschreven: Hi list, Is it possible to use regEx to remove spaces before and after quotes, and, if yes, how ? Example : my beautiful laundrette becomes my beautiful laundrette Thanks

Re: regEx to remove spaces ?

2006-05-17 Thread Alex Tweedly
jbv wrote: Hi list, Is it possible to use regEx to remove spaces before and after quotes, and, if yes, how ? Example : my beautiful laundrette becomes my beautiful laundrette I'm not entirely clear on what you're asking for ... given the description (remove spaces before

Re: regEx to remove spaces ?

2006-05-17 Thread Alex Tweedly
Mark Schonewille wrote: Hi JB, Again, no regex. I looked into regex, but I can't find how to replace quoted strings without knowing the whole string in advance. It would be great if someone came up with a regex solution for this. In the mean time, this function seems to do the job quite

Re: regEx to remove spaces ?

2006-05-17 Thread Jim Ault
On 5/17/06 2:45 AM, jbv [EMAIL PROTECTED] wrote: Is it possible to use regEx to remove spaces before and after quotes, and, if yes, how ? Example : my beautiful laundrette becomes my beautiful laundrette There are a few ways to use RegEx, depending on the exact situations you

Re: regEx to remove spaces ?

2006-05-17 Thread J. Landman Gay
jbv wrote: Hi list, Is it possible to use regEx to remove spaces before and after quotes, and, if yes, how ? Example : my beautiful laundrette becomes my beautiful laundrette This was harder than I thought it would be. I have something I think works, but it isn't elegant