diff --git a/lib/regexp_parser/expression/classes/backref.rb b/lib/regexp_parser/expression/classes/backref.rb
index <HASH>..<HASH> 100644
--- a/lib/regexp_parser/expression/classes/backref.rb
+++ b/lib/regexp_parser/expression/classes/backref.rb
@@ -16,7 +16,7 @@ module Regexp::Expression
       attr_reader :number
 
       def initialize(token)
-        @number = token.text[3..-2]
+        @number = token.text[token.token.equal?(:number) ? 1..-1 : 3..-2]
         super(token)
       end
     end
Fix number attribute for traditional backref expressions