Go

Go

Made by DeepSource

Regular expression can be simplified GO-C4007

Style
Minor

Simplified regular expressions make the intent clear while being easier to refactor.

Bad practice

package main

import (
    "regexp"
)

func foo() {
    _ = regexp.MustCompile(`(?:a|b|c)   [a-z][a-z]*`)
}

Recommended

package main

import (
    "regexp"
)

func foo() {
    _ = regexp.MustCompile(`[abc] {3}[a-z]+`)
}