Page 1 of 1

Regular Expressions Matching Subroutine

Posted: Wed 17 Oct, 2007 11:52 pm
by Demon
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. :P)

Posted: Thu 18 Oct, 2007 9:56 am
by coelurus
There are a lot of libraries with source code that handle regexps, just have a look.

Posted: Thu 18 Oct, 2007 11:53 am
by Demon
Well, I looked on ticalc.org, but the only one I saw was a matching-only program for the 89.

Posted: Thu 18 Oct, 2007 1:58 pm
by driesguldolf
I'd love to make one, but at the moment I want to continue on my secret project some more (the FindSubstring was a welcome change of scene :D)

Posted: Fri 19 Oct, 2007 8:52 am
by coelurus
There are libraries for the PC which you can port.

Posted: Tue 23 Oct, 2007 12:01 pm
by Demon
Unfortunately I don't know that much ASM (nor will I get time until the middle of Summer to learn it).