rem regexp.bas
rem Test of regexp functions.

def fn replace$ (p0$, p1$, p2$)
	print "p0= "; p0$
	print "p1= "; p1$
	print "p2= "; p2$
	replace$= "[" + p0$ + "-" + p1$ + "-" + p2$ + "]"
fn end

def fn replace2$= "[" + p0$ + "-" + p1$ + "-" + p2$ + "]"

print regexp_instr ("Hola que tal", "QUE", 1)
print regexp_instr (6, "Hola que tal", "QUE", 1)
print regexp_instr (7, "Hola que tal", "QUE", 1)

regexp$=" (q([[:alpha:]])+e) "
searched$= "Hola que tal"

print regexp_replace$ (searched$, regexp$, fn replace$)
print regexp_replace$ (searched$, regexp$, fn replace2$)
print regexp_replace$ (searched$, regexp$, "[$0-$1-$2]")

print regexp_replace$ (2, searched$, regexp$, fn replace$)
print regexp_replace$ (2, searched$, regexp$, fn replace2$)
print regexp_replace$ (2, searched$, regexp$, "[$0-$1-$2]")
