>>-pos-(-haystack-)----------------------------------------><
Example 5.199. Class REGULAREXPRESSION - haystack method
str = "It is the year 2002!" myRE = .RegularExpression~new("[1-9][0-9]*") begin = myRE~pos(str) if begin > 0 then do year = str~substr(begin, myRE~position - begin + 1) say "Found the number" year "in this sentence." end ::requires "rxregexp.cls"
Found the number 2002 in this sentence.