# Gsub in Probable Iterations (#141)

**URL:** <https://www.ruby-forum.com/t/gsub-in-probable-iterations-141/116353>\
**Category:** Ruby\
**Created:** [October 4, 2007, 6:46pm UTC](https://www.ruby-forum.com/t/gsub-in-probable-iterations-141/116353 "2007-10-04T18:46:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roland\_Cruesemann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@Roland\_Cruesemann](https://www.ruby-forum.com/u/Roland_Cruesemann)\
**Post date:** [October 4, 2007, 6:46pm UTC](https://www.ruby-forum.com/t/gsub-in-probable-iterations-141/116353/1 "2007-10-04T18:46:54Z")

</div>

I think

gsub(/(\d)(\d)/, ‘\1,\2’)

doesn’t work.  
It should be

gsub(/(\d)(?=\d)/, ‘\1,’)

instead.
