Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

StringScanner.new

StringScanner.new(string, fixed_anchor: false)
StringScanner.new(string, dup = false)

Creates a new StringScanner object to scan over the given string.

If fixed_anchor is true, A always matches the beginning of the string. Otherwise, A always matches the current position.

dup argument is obsolete and not used now.

See also .must_C_version #<< #[] also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0