shinymud / ShinyMUD

A text-based, multiplayer, online adventure game.
shiny.incendiarysoftware.com
Other
41 stars 10 forks source link

organize and compile regular expressions. #28

Open delightedCrow opened 12 years ago

delightedCrow commented 12 years ago

There are several regular expressions that we reuse a lot, and have rewritten several different places. It might be a good idea to move all the regular expressions to a single file (like shinymud/lib/regex.py) that uses re.compile to compile all of the regular expressions ahead of time, and maybe even some functions that return either False (if no matches) or a dictionary (if matches).

This way all of the different places that use the same expression can have it written in a single place, and if it is compiled with re.compile it is faster, and easier to reuse.