DIY Regular Expressions | Hackaday

0

In the Star Wars universe, not everyone uses a lightsabe, and those who do wield them had to build them themselves. There’s something to be said about that strategy. Building a car or a radio is a great way to learn how those things work. That’s what [Low Level JavaScript] points out about regular expressions. Sure, a lot of people think they are scary. So why not write your own regular expression parser and engine? Get that under your belt and you’ll probably never fear another regular expression.

Of course, most of us probably won’t do it ourselves, but you can still watch the process in the video below. The code is surprisingly short, but don’t expect all the bells and whistles you might find in Python or even Perl.

In the hands of the skilled, regular expressions are very powerful and offer a quick way to split apart text data. Like a lot of powerful ideas, the basic concept — that of a finite state machine — is really simple. It is the application to real problems that becomes difficult.

If you want a primer on regular expressions that doesn’t require you to write your own tools, we have had a few posts that can help. If you just want some practice, try a crossword puzzle.

For the latest tech news and updates, Install TechCodex App, and follow us on Google News,  Facebook, and Twitter. Also, if you like our efforts, consider sharing this story with your friends, this will encourage us to bring more exciting updates for you.

Source

Get real time updates directly on you device, subscribe now.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More