home.social

#regexps — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #regexps, aggregated by home.social.

  1. Best answer on regexps ever? 🧐 😎

    - What is the plural form of regex?

    - If you've used more than one of them, you'll know that the plural of "regex" is "regrets." – cjs (Mar 14, 2022 at 23:46)

    #regex #regexps #programmer #programming #devops #regularexpression

  2. Spent half a day polishing complex #regexps in #vim . And they work too, but perl has a little different standard, so I'm basically stuck in grep -p punching a file until it works. As they say in #taoup , sometimes you just have to brute force prototype. #unix #bashcore #hobbylinguist #hobbytranslator

  3. @Codely @drupler It helps to build your complicated #RegularExpressions in pieces and store them in separate variables. You can then test them in isolation and not be confused when you concatenate them together for your actual matching.

    Both #PHP and #JavaScript also support named capture groups if you’re doing replacements. They’re a lot more readable.

    Also, PHP’s #PCRE-based engine has a PCRE_EXTENDED flag that lets you add whitespace, newlines, and comments.

    #regexes #regexps