Skip to content

Commit

Permalink
Clean: Add missing regex escapes
Browse files Browse the repository at this point in the history
 #ignore
  • Loading branch information
sanssecours committed Sep 11, 2022
1 parent 1919de7 commit 9deda77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Support/bin/clean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class String
# >> '${NAME/-/o/}'.replace_name('- - -')
# => 'o\\ o\\ o'
def replace_name(name, regex_escape_name = true)
gsub(%r{\${NAME(?:/([^/]+)/([^/]+)/)?}}).each do |_match|
gsub(%r{\$\{NAME(?:/([^/]+)/([^/]+)/)?\}}).each do |_match|
pattern = Regexp.last_match(1)
replacement = Regexp.last_match(2)
name = name.gsub(pattern, replacement) if pattern && replacement
Expand Down

0 comments on commit 9deda77

Please sign in to comment.