On 23 Oct 2005, at 11:23, Dave Cragg wrote:

I assumed that Revolution would do what it promised and didn't check this.

Try
answer replaceText("A C","^ *","")
I get "C", which obviously is not correct.
If I remove the "*", I get "A C"


This may be a bug. (I'm not sure.)

To expand on why I wasn't sure if it was a bug or not.

A regular expression consisting of a single character (or single character set) followed by the * (zero or more matches) quantifier will always match. Therefore it's not really a useful construction. If it always matches, replaceText will presumably always try to replace the matched text. But in this case, it has matched an empty string, so I guess the engine is confused about where the replacement should be made. As far as I know, replaceText always works when the above construction is used in combination with another expression (e.g yx*, x*y, yx*z), so if it is a bug, I don't think it can be considered a serious one.

answer replaceText("A C","^ +","")

The above works because the match can fail, in which case no replacement is made.

Cheers
Dave
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to