Posts: 1,000
	Threads: 253
	Joined: Feb 2008
	
	
 
	
	
		Anyway to have a REPLACERX callback function that handles matching multiple matches?
for example:
str s="HELLO WORLD ~ hello world"
s.replacerx("(.+) ~ (.+)" "$2 ~ $1")
out s
So in the example, handle that switch of the matches in a function?
	
 
 
	
	
	
		
	Posts: 1,000
	Threads: 253
	Joined: Feb 2008
	
	
 
	
	
		I sort of figured it out.
function# REPLACERXCB&x
str s1.get(x.match x.vec[1].cpMin x.vec[1].cpMax)
str s2.get(x.match x.vec[2].cpMin x.vec[2].cpMax)
x.match=F"{s1.lcase} ~ {s2.ucase}"
 
 
	
	
	
		
	Posts: 12,239
	Threads: 144
	Joined: Dec 2002
	
	
 
 
	
	
	
		
	Posts: 12,239
	Threads: 144
	Joined: Dec 2002
	
	
 
	
	
		str s1.get(x.subject x.vec[1].cpMin (x.vec[1].cpMax-x.vec[1].cpMin))
str s2.get(x.subject x.vec[2].cpMin (x.vec[2].cpMax-x.vec[2].cpMin))