Fork me on GitHub

If i understand correctly, :auto-whitespace :standard inserts <whitespace>? rules. So that for the parser

(def words-and-numbers-auto-whitespace
    "sentence = token+
     <token> = word | number
     word = #'[a-zA-Z]+'
     number = #'[0-9]+'"

    :auto-whitespace :standard))
(words-and-numbers-auto-whitespace "abc 123 45 de") and (words-and-numbers-auto-whitespace "abc123 45de") produces the same result. Is there any method of instead inserting non-optional whitespace rules, which in this case would disallow "abc123 45de"`?


@sigve.nordgaard the desired result is only letters and only numbers together in sequence? You could have tokens-numbers and tokens-letters and a sentence can be tokens-numbers+ | tokens-letters+


If I have understood the question. That would only allow contiguous digits or contiguous characters, not a mix