6.12 Using the regexp Fragment

A program using the regexp fragment will have the following structure:

INCLUDE '~beta/basiclib/regexp
--- program: descriptor ---
(# ...
t: ^text
do ...
   'Hello world' -> t[]; t.reset;
   ('\\<w.*\\>', '\\0 champion') -> t.regexp_replace;
   t[] -> putline; (* prints 'Hello world champion' *)
   ...
#)


Basic Libraries - Reference Manual
© 1990-2002 Mjølner Informatics
[Modified: Wednesday October 18th 2000 at 13:14]