SimpleStringScanners.jl

Julia package for lexical scanning operations on a string
Author hsugawa8651
Popularity
0 Stars
Updated Last
8 Months Ago
Started In
March 2024

SimpleStringScanners

Stable Dev Build Status

Helper for scanning fixed-length substring and parsing.

Quick start

julia> using SimpleStringScanners

julia> scanner=SimpleStringScanner("  2 3d-1");

julia> advance!(scanner,3)
"  2"

julia> advance!(scanner,5)
" 3d-1"
julia> using SimpleStringScanners

julia> scanner=SimpleStringScanner("  2 3d-1");

julia> tryparse1Int64(scanner,3)
2

julia> tryparse1Float64(scanner,5)
0.3
julia> using SimpleStringScanners

julia> scanner=SimpleStringScanner(" 12 34");

julia> tryparse1Int64(scanner, r"\d+")
12

julia> tryparse1Int64(scanner, r"\d+")
34