Regular Expressions Matching Subroutine

Got a brilliant program idea? Let us know!

Moderator: MaxCoderz Staff

Post Reply
User avatar
Demon
Regular Member
Posts: 85
Joined: Wed 31 Jan, 2007 12:11 am
Location: (806), Texas
Contact:

Regular Expressions Matching Subroutine

Post 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)
Last edited by Demon on Thu 18 Oct, 2007 7:00 pm, edited 2 times in total.
"Python has dynamic typing, and dynamic binding, which means that not only does it make a great secretary, it is also pretty damn kinky." --Henry the Adequate

<My Artwork>
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

There are a lot of libraries with source code that handle regexps, just have a look.
User avatar
Demon
Regular Member
Posts: 85
Joined: Wed 31 Jan, 2007 12:11 am
Location: (806), Texas
Contact:

Post by Demon »

Well, I looked on ticalc.org, but the only one I saw was a matching-only program for the 89.
"Python has dynamic typing, and dynamic binding, which means that not only does it make a great secretary, it is also pretty damn kinky." --Henry the Adequate

<My Artwork>
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post 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)
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

There are libraries for the PC which you can port.
User avatar
Demon
Regular Member
Posts: 85
Joined: Wed 31 Jan, 2007 12:11 am
Location: (806), Texas
Contact:

Post by Demon »

Unfortunately I don't know that much ASM (nor will I get time until the middle of Summer to learn it).
"Python has dynamic typing, and dynamic binding, which means that not only does it make a great secretary, it is also pretty damn kinky." --Henry the Adequate

<My Artwork>
Post Reply