I love RegEx, I use it every day and I will show you how to use it to easily get some smaller and larger tasks done.
But...
Don’t use i...
For further actions, you may consider blocking this person and/or reporting abuse
Great article, good topic. If you’re an expert, there’s no reason not to add regexes to your bag of tricks. The key is to understand not only what happens logically, but also the runtime consequences. For example, take PCRE2, an ubiquitously available library. In this flavor of extended regex, you can use greedy matching (i.e., \d++). Used right, along with other constructs, you can judiciously avoid backtracking by the regex state machine and make your regexes fast and lean. I would advise not to be afraid of them, but like swords, to respect them and understand how to work with them. So it is often with powerful things. :)
Thanks 🙏
Since I would not consider myself as an expert, I would not do it :)
I would still vote against if there is any more readable alternative. Strive for readability/maintainability and only optimize for speed if it’s necessary.
Of course! Makes sense.
As an alternative to RegEx Golf, I've found Regex Crossword to be pretty fun!
Good!
Thanks, I will have a look!
Looks like you’ve started a markdown link but missed the url... ;)
lol oops: regexcrossword.com/
I really have to learn more regex. I use the online tools to figure what I need, but I really need to learn more on it, so it's more ingrained. Especially on search and replace in editors.
Thanks for the article.
I love regular expressions! I was able to circumvent using two whole different APIs by employing some very clever regex string manipulation in one of my projects. The speed improvement is unparalleled.
It depends on the circumstances and requirements but I’d still reply with:
dev.to/stealthmusic/comment/cnm2
I'd say that regex should be used if they can make a significant difference and you're aware of the scope of the problem being solved by it. That's where Cloudflare went wrong, I'd say. I use it for url formatting so even if it goes wrong, all I get is a 404 hopefully :P
Thanks for your advise. I absolutely share your views, so I have to ask if you actually read the first section about „not to use it in production“? ;)
I even use the results of such an operation only for testing purposes.
BTW, I just added a disclaimer, just in case what I wrote here could be misunderstood. I don’t mean something like „using regex is dangerous but I will show you how to do it right“. That’s absolutely not what I intended.
I read this, and fatefully was given the task of taking taking two excel columns of 6,000 zip codes and turning them in to arrays. Made incredibly quick work of that, so thanks!
Haha, I‘m glad my article could help! 😊
Thanks @stealthmusic . It was very helpful. I tried it, and it is amazing !
Glad it helps. There are certainly more things to explore and learn. :)
Nice article. Another alternative, an online visual regex tester: extendsclass.com/regex-tester.html