All shall grovel before the mighty Regex

Kunark has posted some valuable insights about the all-powerful Regex and its plans for humanity: http://www.byond.com/members/ Kunark?command=view_post&post=40292

But my esteemed colleague leaves out one crucial detail: what, exactly, is Regex?

A reasonable definition (taken from the third link below) is: "Regular expressions, or regexes for short, are a way to match text with patterns. They are a powerful way to find and replace strings that take a defined format. For example, regular expressions can be used to parse dates, urls and email addresses, log files, configuration files, command line switches or programming scripts."

Since the notion of "searching the Internet" is foreign to many people even in this enlightened age, I've done a minimal amount of work on BYOND developers' behalf. Here, then, are some sites with fairly gentle introductions to the concept:

http://www.digitalamit.com/article/regular_expression.phtml
http://www.codeproject.com/KB/string/re.aspx
http://www.aivosto.com/vbtips/regex.html

If it sounds interesting to you, check out this search and let the games begin!

http://www.byond.com/ members/?command=search&text=regex&type=resources


Posted by Gughunter on Wednesday, March 12, 2008 08:18PM - 6 comments / Members say: yea +0, nay -0

« Archipelago Generation With Cellular Automata · Welcome, Novice Programmer! »

Login to post a comment.

#6 Jermman:  

Kunark wrote:
> Oh, and by the way, here is an expression that might save some of you some pain while you're learning, and luckely it's fairly simple. I know it was a pain for me while I was learning because of how much I dealt with HTML and attributes. This is how you disclude text or a pattern from your matches:
>
> /\b(?!mytext\b)\w+?\b/g
>
> That would match all words except "mytext".

Have I mentioned I love you?

Wednesday, March 12, 2008 11:24PM

#5 Kunark:  

Oh, and by the way, here is an expression that might save some of you some pain while you're learning, and luckely it's fairly simple. I know it was a pain for me while I was learning because of how much I dealt with HTML and attributes. This is how you disclude text or a pattern from your matches:

/\b(?!mytext\b)\w+?\b/g

That would match all words except "mytext".

Wednesday, March 12, 2008 10:14PM

#4 Kunark:  

I learned most of my regex knowledge from http://www.regular-expressions.info/, but the site doesn't do very good explaining it, but frankley it's still one of the best sites dispite its poor quality.

Best way to learn it is just to fudge around with it on one of the many regex tester sites. My favorite is http://regexlib.com/RETester.aspx.

Problem is that there are so many different regex engines that some things you will be taught might not be compatible with your engine. For example, in PHP I have to work around look-behind regex limitations, but I wouldn't need to in .NET.

Wednesday, March 12, 2008 10:09PM

#3 Jermman:  

Oh man. This is insanely simple, why have I not learned this earlier? This will really improve a project of mine.

Wednesday, March 12, 2008 09:36PM

#2 Gughunter:  

Jtgibson wrote:
> Although the entire site is one giant ad for PowerGREP, RegexBuddy, and/or EditPad Pro, I also recommend
>
> http://www.regular-expressions.info/
>
> for quick reference and/or tutorials.

Thanks JT! (IMHO, I don't mind ads at all as long as they aren't trying to secretly install software on my system.)

Wednesday, March 12, 2008 08:26PM

#1 Jtgibson:  

Although the entire site is one giant ad for PowerGREP, RegexBuddy, and/or EditPad Pro, I also recommend

http://www.regular-expressions.info/

for quick reference and/or tutorials.

Wednesday, March 12, 2008 08:23PM

 

 

Programming Help

Get Started - A quick overview of the tools available for learning to program in BYOND.

DM Guide - This is the first place you should look if you're new to BYOND's language DM. Some people call this the "blue book".

ZBT parts 1, 2, & 3 - Zilal's excellent tutorial series, teaching you the basics of how to get started writing games in BYOND.

Your First World and Step BYOND - Sample games that you can study to help you learn.

DM Reference - Handy for novice users and advanced programmers alike, this documents everything you need to know about the DM language.

Skin Reference - If you want to give your game a custom interface, this tells you what you can do with "skins" and how to work with them.

BYOND Resources - Demos and libraries you can download to help you with your creation.

Publishing Games

Publishing Games - A guide for putting your creations on the BYOND hub to share with others.

Recording Videos - If you want to find out how to make a video of your game and put it on YouTube or another site, this can get you started.

Keywords