

Task

   match a string against a regular expression
   substitute part of a string using a regular expression


 
#include <hopper.h>
 
main:
   expReg="[A-Z]{1,2}[0-9][0-9A-Z]? +[0-9][A-Z]{2}"
   flag compile = REG_EXTENDED
   flag match=0
   número de matches=10, T1=0
 
   {flag compile,expReg} reg compile(T1)  // compile regular expression, pointed whit T1
   {flag match,número de matches,T1,"We are at SN12 7NY for this course"},reg match, // execute
   println 
   reg free(T1)   // free pointer to regular expression compiled.
 
exit(0)
 