mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
Add test case for infinite loop in RE
This commit is contained in:
9
tests/stdlib/treloop.nim
Normal file
9
tests/stdlib/treloop.nim
Normal file
@@ -0,0 +1,9 @@
|
||||
discard """
|
||||
output: "@[(, +, 1, 2, )]"
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
let str = "(+ 1 2)"
|
||||
var tokenRE = re"""[\s,]*(~@|[\[\]{}()'`~^@]|"(?:\\.|[^\\"])*"|;.*|[^\s\[\]{}('"`,;)]*)"""
|
||||
echo str.findAll(tokenRE)
|
||||
Reference in New Issue
Block a user