Menu

Improvement of group capturing

In earlier versions replacement captured by named group could appear changed later, for example
(^(((#)|fooer)~A,foo),(((#)|barrier)~A,bar))|$A
for string "3 foo" would give "barrier" because after fooer was successfully captured, engine tries to match second half and captures group before understanding that whole part is unsuitable.

Now it is corrected (though grouping capturing mechanism now is bit tougher and may be requires optimization).

Also now Optional elements could be captured correctly, for example:
((#)~A,(?(^thousand|000,million|000000))~B,(^roubles,euro,dollars)~C)|$A$B $C
would change "3 thousands euro" to "3000 euro" and "1 dollar" to "1 dollar"... (earlier this would not work)

(first release after this improvement could throw NullPointerException - now it is corrected)

Posted by Anonymous 2011-06-22

Log in to post a comment.