For example, this is how my subs current work:
Code: Select all
A scholar has arrived from the west.
ARRIVES FROM THE > W E S T <
Code: Select all
A scholar ARRIVES FROM THE > W E S T <
Code: Select all
A scholar has arrived from the west.
ARRIVES FROM THE > W E S T <
Code: Select all
A scholar ARRIVES FROM THE > W E S T <
Code: Select all
#action %+arrived ^(.+) has arrived from (above|below|the west|the east|the north|the south)(.+)={#print (\$2 + " has ARRIVED FROM >> " + \$3 + \$4 + " <<")}
#action %+s_arrived ^(.+) has suddenly arrived.={#print (\$2 + " has SUDDENLY ARRIVED.")}
Code: Select all
#action %+arrived ^(.+) has arrived from the west(.+)={#print (\$2 + " has ARRIVED FROM THE >> W E S T << " + \$3)}
Thanks! That will get me started quite nicely.Jahara wrote:This isn't exactly what you want, since I use regular expression to match for any of the directions and then leave the text as it is.In order for it to do what you want you would need to modify it similar to this:Code: Select all
#action %+arrived ^(.+) has arrived from (above|below|the west|the east|the north|the south)(.+)={#print (\$2 + " has ARRIVED FROM >> " + \$3 + \$4 + " <<")} #action %+s_arrived ^(.+) has suddenly arrived.={#print (\$2 + " has SUDDENLY ARRIVED.")}
Code: Select all
#action %+arrived ^(.+) has arrived from the west(.+)={#print (\$2 + " has ARRIVED FROM THE >> W E S T << " + \$3)}