# Re: Reverse the Polarity (#143)

**URL:** <https://www.ruby-forum.com/t/re-reverse-the-polarity-143/117321>\
**Category:** Ruby\
**Created:** [October 15, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/re-reverse-the-polarity-143/117321 "2007-10-15T23:48:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jameskelly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@jameskelly](https://www.ruby-forum.com/u/jameskelly)\
**Post date:** [October 15, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/re-reverse-the-polarity-143/117321/1 "2007-10-15T23:48:21Z")

</div>

I made a small mistake in my solution. It will not work on regexes such  
as /a{11,12}/ if the numbers within the range are more than 1 digit. To  
fix this, every instance of “(\d)” in my solution should be replaced  
with “(\d+)”
