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

For the Compleat Fan

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

Postby ssqq » Tue Aug 02, 2016 2:45 pm

Code: Select all
> {[{]}

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

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

ssqq
 
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

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

Postby ssqq » Tue Aug 02, 2016 5:10 pm

Code: Select all
> {[\Q{\E]}
ERR: string token too long : "[\\Q{\\E]}"
> {[\Q\{\E]}
ERR: string token too long : "[\\Q\\{\\E]}"
ssqq
 
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

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

Postby ssqq » Tue Aug 02, 2016 5:15 pm

But if code is in file, it is OK.

Code: Select all
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
\{\}\(\)

ssqq
 
Posts: 88
Joined: Sun May 04, 2014 12:49 pm


Return to Anything else we might add?

Who is online

Users browsing this forum: No registered users and 3 guests

cron