Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

backOpen Source→ranges-regex→Examples

Table of Contents

  • Quick Take
  • Clashing replacement values
  • Give deletion precedence with a null replacement
  • Require the global flag so every match can be collected safely
  • Slice the source text using the returned ranges
  • Merge adjacent regex matches into one range
  • Nothing was found
  • Replacing values
  • Advance over a complete Unicode code point after an empty match
  • Turn zero-width matches into insertion ranges
↑ back to top

Quick Take

↑ back to top

Clashing replacement values

↑ back to top

Give deletion precedence with a null replacement

↑ back to top

Require the global flag so every match can be collected safely

↑ back to top

Slice the source text using the returned ranges

↑ back to top

Merge adjacent regex matches into one range

↑ back to top

Nothing was found

↑ back to top

Replacing values

↑ back to top

Advance over a complete Unicode code point after an empty match

↑ back to top

Turn zero-width matches into insertion ranges

↑ back to top
back 

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab