mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
10 lines
196 B
Nim
10 lines
196 B
Nim
discard """
|
|
output: "@[(, +, 1, 2, )]"
|
|
"""
|
|
|
|
import re
|
|
|
|
let str = "(+ 1 2)"
|
|
var tokenRE = re"""[\s,]*(~@|[\[\]{}()'`~^@]|"(?:\\.|[^\\"])*"|;.*|[^\s\[\]{}('"`,;)]*)"""
|
|
echo str.findAll(tokenRE)
|