char "{" could not write in char class with {..}

Started by ssqq, August 02, 2016, 07:45:47 AM

Previous topic - Next topic

ssqq


> {[{]}

ERR: string token too long : "[{]}"
> {[{]}

ERR: string token too long : "[\{]}"
;; nnn also could not recognize in {..}
> {123}
"\123"


ssqq

#1

> {[Q{E]}
ERR: string token too long : "[\Q{\E]}"
> {[Q{E]}
ERR: string token too long : "[\Q\{\E]}"

ssqq

#2
But if code is in file, it is OK.



ssqq@X61:~/spp-newlisp$ cat debug.lsp
(constant 'say println)

(define (regex-str-char @str)
  (replace {([Q()[]{}|.+*?^$E])} @str (string {} $1) 0))

(say (regex-str-char "{}()"))

(exit)
ssqq@X61:~/spp-newlisp$ newlisp debug.lsp
{}()