Regular Expressions Matching Subroutine
Posted: Wed 17 Oct, 2007 11:52 pm
Would it be possible for someone to write a subroutine that
- does matching based on regular expressions?
- has a feature that would return in a delimited string the matches found?
Input: "THIS IS AWESOME DUDE"
Comparison: "* IS *"
Result: 1
Input: "HELLO MY NAME IS SCOTT"
Comparison: "$1 (MY NAME IS|I AM) $2"
Result: "1=HELLO2=SCOTT"
I'd find a subroutine like this very useful for my AI program (which is in hybrid-BASIC and needs all the speed it can get. )
- does matching based on regular expressions?
- has a feature that would return in a delimited string the matches found?
Input: "THIS IS AWESOME DUDE"
Comparison: "* IS *"
Result: 1
Input: "HELLO MY NAME IS SCOTT"
Comparison: "$1 (MY NAME IS|I AM) $2"
Result: "1=HELLO2=SCOTT"
I'd find a subroutine like this very useful for my AI program (which is in hybrid-BASIC and needs all the speed it can get. )