summaryrefslogtreecommitdiff
path: root/lib/pry/helpers/text.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pry/helpers/text.rb')
-rw-r--r--lib/pry/helpers/text.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pry/helpers/text.rb b/lib/pry/helpers/text.rb
index b1fee03f..4ccedf83 100644
--- a/lib/pry/helpers/text.rb
+++ b/lib/pry/helpers/text.rb
@@ -44,7 +44,7 @@ class Pry
# @param [String, #to_s] text
# @return [String] _text_ stripped of any color codes.
def strip_color(text)
- text.to_s.gsub(/(\001)?\e\[.*?(\d)+m(\002)?/, '')
+ text.to_s.gsub(/(\001)?(\e\[(\d[;\d]?)*m)(\002)?/, '')
end
# Returns _text_ as bold text for use on a terminal.