aboutsummaryrefslogtreecommitdiffstats
path: root/lib/scanf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scanf.rb')
-rw-r--r--lib/scanf.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/scanf.rb b/lib/scanf.rb
index e2f0d04c14..3d56e4aabd 100644
--- a/lib/scanf.rb
+++ b/lib/scanf.rb
@@ -467,11 +467,11 @@ module Scanf
end
def letter
- /%\*?\d*([a-z\[])/.match(@spec_string).to_a[1]
+ @spec_string[/%\*?\d*([a-z\[])/, 1]
end
def width
- w = /%\*?(\d+)/.match(@spec_string).to_a[1]
+ w = @spec_string[/%\*?(\d+)/, 1]
w && w.to_i
end