Regex * — Zero or More (Greedy)

* matches the preceding element zero or more times, greedily (as many as possible). For example a* matches "", "a", "aaa". Add ? for lazy matching (*?).

Open the interactive DevRef Hub tool →

Key facts

Token*
Repetitions0 to ∞
ModeGreedy (max length)
Lazy form*?

Frequently asked questions

What does * mean in regex?

Zero or more repetitions of the preceding element, greedy by default.

* vs +?

* allows zero matches; + requires at least one.

Related pages

Regex * — Star Quantifier is part of DevRef Hub on GOAT Lab — a free reference you can use without signing up, and it works offline. Open the tool above for any custom value.

Advertise

Part of GOAT Lab — 26 free, browser-based science, engineering and developer tools. No sign-up.