DEV Community

timfong888
timfong888

Posted on

3 1

How to write "four letter word" in regex?

Hi, I am writing a blog post and thinking of adding some humor (dunno if it will fly), but basically referencing the typical "taking the s**t our of x" and replacing the four letter word with regex.

Would this be clear, but also accurate (and bonus, even a little bit funny)?

Taking the /s[a-z]t{4}/ Out of CLAs

I wasn't sure whether I should use {d} or use the \b for boundary beginning and end.

Should it be more explicit and have it match where the first character is s and last is t?

Open to other suggestions!

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay