John D. Cook 6/24/2026

Regular expressions that work “everywhere”

Read Original

This article discusses the challenge of varying regular expression implementations across different tools and provides a practical guide to using a subset of regex features that work consistently in sed, awk, grep, and Emacs. It explains how awk serves as a lowest common denominator, notes Emacs as an oddball with different syntax requirements, and lists compatible features such as literals, character classes, anchors, quantifiers, alternation, capturing groups, and backreferences. The author emphasizes avoiding advanced features like look-around to ensure portability, making it useful for developers who need cross-platform regex solutions.

Regular expressions that work “everywhere”

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet