12-06-2007, 06:26 PM
But there are no bakreferences. Do you mean subpaterns? Anyway, a backreference match is exactly the same as the subpatern that it references.
If there are > 1 subpaterns, you need ARRAY. If 1, str.
str c; ARRAY(str) a
c="computers.com"
findrx(c "(c.*s)\.(\D{2,3})" 0 0 a) ;;no backreferences
;findrx(c "(c\D{2}).*?\.(\1)" 0 0 a) ;;backreference \1
out a[0]
out a[1]
out a[2] ;;if it is backreference, it is equal to a[1]
If there are > 1 subpaterns, you need ARRAY. If 1, str.