---
title: "Regular expressions that work “everywhere”"
url: https://daily.dev/posts/regular-expressions-that-work-everywhere--eazvtdam6
source_url: https://www.johndcook.com/blog/2026/06/23/regex-everywhere
type: article
source: "Lobsters"
published: 2026-06-29T16:06:44.098Z
updated: 2026-06-29T16:07:01.910Z
tags: ["linux", "bash"]
reading_time: 3
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Regular expressions that work “everywhere”

**[Lobsters](https://daily.dev/sources/lobsters)** · 3 min read · 0 upvotes · 0 comments

## Summary

A practical guide to identifying which regular expression features work across multiple tools — specifically sed, awk, grep, and Emacs. The strictest portable subset includes only literals, character classes, and basic special characters. Using GNU versions with the -E flag expands compatibility, with awk serving as the lowest common denominator. Emacs is the main oddball, requiring backslashes before metacharacters like +, ?, (, ), {, }, and | and using different whitespace class syntax. A consolidated list of features that work across all four tools is provided, including dot, anchors, character classes, quantifiers, alternation, capturing groups, backreferences, and word boundary markers — with a caveat about gawk's backreference support.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.johndcook.com/blog/2026/06/23/regex-everywhere>

## Similar posts on daily.dev

- [The true power of regular expressions](https://daily.dev/posts/the-true-power-of-regular-expressions-bmqlp7bsa) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux), [#bash](https://daily.dev/tags/bash)

[View this post on daily.dev](https://daily.dev/posts/regular-expressions-that-work-everywhere--eazvtdam6)
