Is regex an art form?

I find when I need to resort to, or maybe it’s a good choice, that when using regex it helps solve some coding needs in a JavaScript function. I use online regex testing like regex101, and also I will sometimes look for answers on the web. I come up with solutions that seem to work very well but I can’t help but thinking that there’s more than one or multiple regex solutions attainable in order to match or create groups. I just would like to know if my feelings about this ‘more than one way to skin a cat’ solution is the proper way to think about this or am I just ‘barking up the wrong tree’? :wink:

1 Like

Regex is a complete mystery for me. I know the basics and with enough trial and error I can generate the pattern I need, but it’s a lot of guesswork. For things like regex, I always wanted a way to just ask my Alexa or Google Home device to help me out.

LOL I may have to buy one of those units now! :wink:

Same here, i recall back in my as3 days every so often it i had a question here on kirupa forums, someone would post a magical regex that fixed it. Its probably one of the only confirmed solution to a problem i never stopped to at least partially understand.

I recall really trying to learn regex in AS3. It was often frustrating but also a lot of fun.

This thread is really inspiring me to go back and really learn regex now! :open_book:

3 Likes

I’ve been lately using regex in react components where I’m bringing in external data, and metadata where I may need to separate some things out, especially HTML elements, images, etc. Always fun when an npm package gets an update which may all of a sudden break one’s regex. You should see my regex for verifying a person’s name in a form… :dizzy_face: lol

Funny I just bought a book about a week ago on regex…

1 Like