---
title: "Discussion on \"Why your regex matches too much: greedy vs lazy quantifiers\" | Hashnode"
description: "Discussion on \"Why your regex matches too much: greedy vs lazy quantifiers\". You write <.+> to grab an HTML tag, run it on <b>bold</b>, and get the whole string instead of <b>. That's greediness, and it trips up almost everyone once.\nGreedy by default\nQuantifiers like *, + and"
url: "https://hashnode.com/posts/why-your-regex-matches-too-much-greedy-vs-lazy-quantifiers/6b02777186eec2d4a48d94f0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why your regex matches too much: greedy vs lazy quantifiers](https://gotoolsonline.hashnode.dev/why-your-regex-matches-too-much-greedy-vs-lazy-quantifiers?utm_source=hashnode&utm_medium=feed)

You write <.+> to grab an HTML tag, run it on <b>bold</b>, and get the whole string instead of <b>. That's greediness, and it trips up almost everyone once. Greedy by default Quantifiers like \*, + and

5d ago · 2 min read · gotoolsonline.hashnode.dev  
Read the article

-   [#regex](https://hashnode.com/tag/regex)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#programming-ciovqvfcb008mb253jrczo9ye](https://hashnode.com/tag/programming-ciovqvfcb008mb253jrczo9ye)

## Written by

[GoToolsOnline](https://hashnode.com/@gotoolsonline)

@gotoolsonline

  
[View profile](https://hashnode.com/@gotoolsonline)

Free online tools for developers: JSON, text, image and more. No sign-up.

I run GoToolsOnline (gotoolsonline.com), a free collection of browser tools for developers and students. No sign-up.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
