---
title: "Discussion on \"Regex: Tokenize repeating characters in a string\" | Hashnode"
description: "Discussion on \"Regex: Tokenize repeating characters in a string\". TL;DR: Tokenize the repeating characters in a string with (\\w)\\1*.\n\nSome coding challenges (and the occasional real-world challenge) require you to act on the repeating characters in a string. A couple of examples include finding binary gaps, like th..."
url: "https://hashnode.com/posts/regex-tokenize-repeating-characters-in-a-string/5fbe85ef08c16c34b89c4367"
---

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

Discussion

# [Regex: Tokenize repeating characters in a string](https://spaceaardvark.hashnode.dev/regex-tokenize-repeating-characters-in-a-string?utm_source=hashnode&utm_medium=feed)

TL;DR: Tokenize the repeating characters in a string with (\\w)\\1\*. Some coding challenges (and the occasional real-world challenge) require you to act on the repeating characters in a string. A couple of examples include finding binary gaps, like th...

Nov 25, 2020 · 2 min read · spaceaardvark.hashnode.dev  
Updated Feb 14, 2021  
Read the article

-   [#regex](https://hashnode.com/tag/regex)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#python](https://hashnode.com/tag/python)

## Written by

[Space Aardvark](https://hashnode.com/@spaceaaradvark)

@spaceaaradvark · Texas, USA

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

Frontend, Fintech, and Fadoodles

Hi, I'm Seth Livingston, a Senior Software Engineer at Moov Financial. Aardvark by abraham.williams (https://www.flickr.com/photos/14939682@N02) Space background by Jeremy Perkins (https://unsplash.com/@jeremyperkins?utm\_source=unsplash&amp;utm\_medium=referral&amp;utm\_content=creditCopyText)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
