Regex characters

Post Reply
Xikue
Posts: 6
Joined: Sun Jul 05, 2009 4:24 am

Regex characters

Post by Xikue »

1.13 in the manual doesn't explicitly explain ^, $, (\w+), (\d+) and .*. I've also seen a (\s) not mentioned in the manual. Would it be possible to get a table in the manual of what they match? The list below is what I've found so far from other parts of the manual or posts here in the forums.
^ start of line
$ end of line
\w+ single alphanumeric character
\d+ number?
.* wildcard?
.*? ?
\s space?
others?
Thanks in advance!

Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

Re: Regex characters

Post by Caled »

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

That site has a lot of information and tutorials. A couple of the more useful pages on it are:

For a one-page list of most special characters/matching groups
http://www.regular-expressions.info/reference.html

For a basic explanation of concepts like greedy/lazy, repitition, alternation, grouping etc
http://www.regular-expressions.info/quickstart.html


Lastly, a site to let you test whether you have the right pattern or not:
http://www.regexpal.com/
(Mudlet will eventually have something like that built into it, but until then that is a handy web app.)

Xikue
Posts: 6
Joined: Sun Jul 05, 2009 4:24 am

Re: Regex characters

Post by Xikue »

Thanks!

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Regex characters

Post by Vadi »

Definitely a good consideration for the manual though, thanks!

Post Reply