diff --git a/lib/core_ext/string.rb b/lib/core_ext/string.rb
index f93035d93..3db6fe1fb 100644
--- a/lib/core_ext/string.rb
+++ b/lib/core_ext/string.rb
@@ -306,7 +306,7 @@ class String
string.gsub!(%r\
[[:space:]]*(
([[:space:]]*)){2,}\im, '
\3')
string.gsub!(%r\[[:space:]]*(
[[:space:]]*){3,}[[:space:]]*
\im, '
')
string.gsub!(%r\[[:space:]]*(
[[:space:]]*){1,}[[:space:]]*
\im, '
')
- string.gsub!(%r\[[:space:]]*(
[[:space:]]*{1,}
[[:space:]]*){2,}
\im, '
')
+ string.gsub!(%r\[[:space:]]*(
[[:space:]]*
[[:space:]]*){2,}
\im, '
')
string.gsub!(%r\[[:space:]]*
(
[[:space:]]*){2,}[[:space:]]*\im, '
')
string.gsub!(%r{[[:space:]]*
(
[[:space:]]*)+[[:space:]]*
}im, '
')
string.gsub!(%r\([[:space:]]*
[[:space:]]*){2,}\im, '
')