And what about a one line non regex solution like: put word 1 to -1 of x into x?
(I know, not as elegant and impressive as a true regex ;-)


Gr W.

On 13 Apr 2005, at 12:14, Matt Denton wrote:

G'day all

Regular Expression syntax in ReplaceText is driving me a bit loopy right now, I was hoping someone out there could work out what I'm doing wrong...

I want a single RegEx expression using ReplaceText to strip out leading and tailing spaces, leaving any spaces in the middle untouched.

I've got it working in 2 lines of code, but I'm SURE I can do it in one. (I've spent an hour trying to reduce this to one line... I know, why not go for a swim or something more constructive with my time...)

This works:

put replaceText(tSomeText, "^ +",empty) into tFirstPass
put replaceText(tFirstPass, " +$",empty) into tSecondPass

But when I try and combine:

put replaceText(tSomeText, "^ ?| +$",empty) into tOnePass

I can't get it to work!! I've tried many variations and the logic SEEMS to be right... obviously not.

Anyone?  I'll award the winner with a jar of Vegemite from Australia.

Cheers

M@
Matt Denton

_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________ use-revolution mailing list [email protected] http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to