re:find_replace_callback() -- example fails
- Posted by _tom (admin) Sep 22, 2010
- 1166 views
Example 1 in the documentation for find_replace_callback() is not working.
A cut and paste copy of the example produces an error...
include std/regex.e as re include std/console.e function my_convert(sequence params) switch params[1] do case "1" then return "one " case "2" then return "two " case else return "unknown " end switch end function regex r = re:new(`\d`) sequence result = re:find_replace_callback(r, "125", routine_id("my_convert")) -- result = "one two unknown " display( result ) /* bash-3.1# eui demo demo.ex:5 in function my_convert() A machine-level exception occurred during execution of this statement ... called from /root/euphoria/include/std/regex.e:1218 in function find_replace_callback() ... called from demo.ex:15 --> See ex.err */