Regex golf anyone?

Ok, so there's a website for playing "Regex golf" here: http://regex.alf.nu/

Basically, you get given some things to match and some things to not match and you have to write a single regular expression (in as few chars as possible) to do it.

Hopefully we'll see some of other top guys in the Regular Expressions Topic Area too... @ozo, @kaufmed, @DanCraciun, @ddrudik

Let me know your score :-)

This is really more like a lounge question so I've kept points to 50...
LVL 35
Terry WoodsIT GuruAsked:
Who is Participating?
 
Dan CraciunConnect With a Mentor IT ConsultantCommented:
Finally got balance. Actually, it was easier once I understood I had to close all tags :)

New score 3756.
0
 
Dan CraciunIT ConsultantCommented:
Cool, did not know that site!

Got stuck at Balance. Got 3 mismatches for 402 points (total 2961). Will try again tonight.

BTW, this is in normal mode. Did not touch hard mode yet. I guess Ozo will start directly in hard mode, to not get bored :)
0
 
Terry WoodsIT GuruAuthor Commented:
Trust me, even the normal mode is tough!
0
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

 
Dan CraciunIT ConsultantCommented:
Finished the first run. 3489 points. Probably can improve, but rushed to finish.

LE: A bit of tinkering. 3511 points. Enough for tonight.
0
 
mccarlConnect With a Mentor IT Business Systems Analyst / Software DeveloperCommented:
I got 3841 but a couple of the regex aren't "in the spirit" of what the puzzle setter was trying to aim for, eg. Glob, Triple, Long Count wouldn't work if a different set of examples were picked. Triples is especially annoying because I know exactly what I want to do but just not how to get that into a regex! :)
0
 
Terry WoodsIT GuruAuthor Commented:
Great score, @mccarl! So far I've managed 3682, and I'm sure that more than a couple of my answers aren't a particularly general pattern either.
0
 
Terry WoodsIT GuruAuthor Commented:
I'm sitting on 407 points for "balance" though I still have an incorrect match. What points do you have for that one, Dan?

I would expect to have substantial room for improvement on "Powers" (57 points) and "Powers 2" (37 points).

No time to go back to it today though... :-(
0
 
Dan CraciunConnect With a Mentor IT ConsultantCommented:
452 at "balance". Though I did somewhat cheat on it to get all the matches. Could not get a general regex so used an alternation for 4 of the matches.
0
 
käµfm³d 👽Connect With a Mentor Commented:
I just saw this thread today. I'll play around with it more tonight. 1500 so far, but I'm only half done, and a couple were just brute force.
0
 
Terry WoodsIT GuruAuthor Commented:
Will have to accept a solution to this question soon, or my name will be mud... any updates on score? :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.