---
title: "*** The previous line contains the naughty word '$&'. if /(ibm|apple|… — Larry Wall Quote #275 | QuotesBy.net"
description: "*** The previous line contains the naughty word '$&'. if /(ibm|apple|awk)/; # :-) — a quote by Larry Wall."
image: "https://quotesby.net/wp-content/themes/quotesby-editorial/assets/og-default.png"
---

> # \*\*\* The previous line contains the naughty word '$&amp;'. if /(ibm\|apple\|awk)/; # :-)

[Larry Wall](https://quotesby.net/Larry-Wall)\#275

[Perl](https://quotesby.net/Larry-Wall/perl/)[Regex](https://quotesby.net/Larry-Wall/regex/)[Moderation](https://quotesby.net/topics/moderation/)

[WhatsApp (opens in a new tab)](https://wa.me/?text=%E2%80%9C%2A%2A%2A%20The%20previous%20line%20contains%20the%20naughty%20word%20%27%24%26%27.%20if%20%2F%28ibm%7Capple%7Cawk%29%2F%3B%20%23%20%3A-%29%E2%80%9D%20%E2%80%94%20Larry%20Wall%20https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F275%2F)[X (opens in a new tab)](https://twitter.com/intent/tweet?text=%E2%80%9C%2A%2A%2A%20The%20previous%20line%20contains%20the%20naughty%20word%20%27%24%26%27.%20if%20%2F%28ibm%7Capple%7Cawk%29%2F%3B%20%23%20%3A-%29%E2%80%9D%20%E2%80%94%20Larry%20Wall&url=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F275%2F)[Facebook (opens in a new tab)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F275%2F)

## About this quote

What does it mean?The previous line contains a prohibited pattern, demonstrated with a humorous regex example.In plain termsA line had a banned word, shown with a regex.What can you take from it?Use regex to detect unwanted content.

### Where it applies

- moderating forums
- searching code

### Putting it to work

- write pattern checks
- log matches

### Questions to consider

- How can regex be both useful and obscure?

### Another view

The example is cryptic without context.

## More from Larry Wall

1. > The autodecrement is not magical.

[Permalink to quote \#274](https://quotesby.net/Larry-Wall/274/ "Permalink to quote 274")
2. > When in doubt, parenthesize. At the very least it will let some poor schmuck bounce on the % key in vi.

[Permalink to quote \#276](https://quotesby.net/Larry-Wall/276/ "Permalink to quote 276")
3. > Remember though that THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR.

[Permalink to quote \#273](https://quotesby.net/Larry-Wall/273/ "Permalink to quote 273")

## Related quotes

1. > Although the Perl Slogan is There's More Than One Way to Do It, I hesitate to make 10 ways to do something. :-)

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#1](https://quotesby.net/Larry-Wall/1/ "Permalink to quote 1")
2. > The north German does not go in for extremes. He has broader horizons than the men from the mountains of Bavaria and Austria.

[Karl Donitz](https://quotesby.net/Karl-Donitz)[Karl Donitz quote \#2](https://quotesby.net/Karl-Donitz/2/ "Permalink to quote 2")
3. > Drink the first. Sip the second slowly. Skip the third.

[Knute Rockne](https://quotesby.net/Knute-Rockne)[Knute Rockne quote \#2](https://quotesby.net/Knute-Rockne/2/ "Permalink to quote 2")

```json
{
    "@context": "https://schema.org",
    "@type": "Quotation",
    "text": "*** The previous line contains the naughty word '$&'. if /(ibm|apple|awk)/; # :-)",
    "url": "https://quotesby.net/Larry-Wall/275/",
    "spokenByCharacter": {
        "@type": "Person",
        "name": "Larry Wall"
    }
}
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://quotesby.net/"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Authors",
            "item": "https://quotesby.net/authors/"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Larry Wall",
            "item": "https://quotesby.net/Larry-Wall"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Quote #275",
            "item": "https://quotesby.net/Larry-Wall/275/"
        }
    ]
}
```
