Hello everyone!
I'm a student from the netherlands working on a parser (using cl-yacc) and I use dso-lex as the lexer-generator, which depends on cl-ppcre (as you might know). Since I want to parse RIF files that require unicode encoded characters, I wanted to extend cl-ppcre with unicode, using cl-unicode. Unfortunately I receive an error when I try to install cl-unicode. When it tries to compute the Hangul syllable names (this happens when loading hash-tables.fasl) I get the following:
Error: `("Unbound Value")' is not of the expected type `number' [condition type: type-error]
Some extra info: - I tried to install cl-unicode with, and without installing flexi-streams and trivial-gray-streams, but both give me the error. - I use Allegro CL
Could you perhaps help me?
Regards,
Noldus Reijnders
PS I also get an error when it tries to load util.lisp saying that +t-count+ is unknown. However, I fixed that by replacing that with the number in the assignment of TCount. Same thing for VCount btw. Maybe that has something to do with Allegro CL?
Hi,
I don't have AllegroCL at hand and I don't have the time to check, but here are three things you should probably try:
1. Can you try to install "from scratch" with ALL existing FASL files, no matter where they are, deleted?
2. Can you try with a different Lisp compiler and see if that works for you?
3. Did you try to install with Quicklisp to make sure that it's not a problem of libraries not working together?
Please let us know if that helps.
Cheers, Edi.
On Thu, Nov 24, 2011 at 1:47 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
Hello everyone!
I'm a student from the netherlands working on a parser (using cl-yacc) and I use dso-lex as the lexer-generator, which depends on cl-ppcre (as you might know). Since I want to parse RIF files that require unicode encoded characters, I wanted to extend cl-ppcre with unicode, using cl-unicode. Unfortunately I receive an error when I try to install cl-unicode. When it tries to compute the Hangul syllable names (this happens when loading hash-tables.fasl) I get the following:
Error: `("Unbound Value")' is not of the expected type `number' [condition type: type-error]
Some extra info:
- I tried to install cl-unicode with, and without installing flexi-streams
and trivial-gray-streams, but both give me the error.
- I use Allegro CL
Could you perhaps help me?
Regards,
Noldus Reijnders
PS I also get an error when it tries to load util.lisp saying that +t-count+ is unknown. However, I fixed that by replacing that with the number in the assignment of TCount. Same thing for VCount btw. Maybe that has something to do with Allegro CL?
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
Hey Edi, Thanks for the quick response! I tried it with CLISP together with quicklisp and that works fine (didn't know of quicklips before but it is awesome!). However when using AllegroCL, quicklips even causes additional errors:When loading lists.lisp:Error: Package "COMMON-LISP" not found. [file position = 160] [condition type: reader-error] I also tried to install cl-unicode again without all the fasl files that were created by cl-unicode and that didn't work. Or did you really mean all fasl-files used by my AllegroCL implementation? If so, is there an easy way to do that, or do I need to remove them by hand? Regards,Noldus
From: edi@weitz.de Date: Fri, 25 Nov 2011 10:32:28 +0100 To: cl-ppcre-devel@common-lisp.net Subject: Re: [cl-ppcre-devel] Error loading cl-unicode
Hi,
I don't have AllegroCL at hand and I don't have the time to check, but here are three things you should probably try:
- Can you try to install "from scratch" with ALL existing FASL files,
no matter where they are, deleted?
Can you try with a different Lisp compiler and see if that works for you?
Did you try to install with Quicklisp to make sure that it's not a
problem of libraries not working together?
Please let us know if that helps.
Cheers, Edi.
On Thu, Nov 24, 2011 at 1:47 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
Hello everyone!
I'm a student from the netherlands working on a parser (using cl-yacc) and I use dso-lex as the lexer-generator, which depends on cl-ppcre (as you might know). Since I want to parse RIF files that require unicode encoded characters, I wanted to extend cl-ppcre with unicode, using cl-unicode. Unfortunately I receive an error when I try to install cl-unicode. When it tries to compute the Hangul syllable names (this happens when loading hash-tables.fasl) I get the following:
Error: `("Unbound Value")' is not of the expected type `number' [condition type: type-error]
Some extra info:
- I tried to install cl-unicode with, and without installing flexi-streams
and trivial-gray-streams, but both give me the error.
- I use Allegro CL
Could you perhaps help me?
Regards,
Noldus Reijnders
PS I also get an error when it tries to load util.lisp saying that +t-count+ is unknown. However, I fixed that by replacing that with the number in the assignment of TCount. Same thing for VCount btw. Maybe that has something to do with Allegro CL?
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
As for the FASL files, I was mainly concerned with the FASL files for CL-PPCRE and other libs. If all your Lisp libs are in one directory, then something like `find . -name '*.fasl' -delete' or somesuch should do it, shouldn't it?
Regarding the AllegroCL problems - are you maybe working in "modern" mode? That could definitely be a problem.
On Fri, Nov 25, 2011 at 12:51 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
Hey Edi,
Thanks for the quick response!
I tried it with CLISP together with quicklisp and that works fine (didn't know of quicklips before but it is awesome!). However when using AllegroCL, quicklips even causes additional errors: When loading lists.lisp: Error: Package "COMMON-LISP" not found. [file position = 160] [condition type: reader-error]
I also tried to install cl-unicode again without all the fasl files that were created by cl-unicode and that didn't work. Or did you really mean all fasl-files used by my AllegroCL implementation? If so, is there an easy way to do that, or do I need to remove them by hand?
Regards, Noldus
From: edi@weitz.de Date: Fri, 25 Nov 2011 10:32:28 +0100 To: cl-ppcre-devel@common-lisp.net Subject: Re: [cl-ppcre-devel] Error loading cl-unicode
Hi,
I don't have AllegroCL at hand and I don't have the time to check, but here are three things you should probably try:
- Can you try to install "from scratch" with ALL existing FASL files,
no matter where they are, deleted?
- Can you try with a different Lisp compiler and see if that works for
you?
- Did you try to install with Quicklisp to make sure that it's not a
problem of libraries not working together?
Please let us know if that helps.
Cheers, Edi.
On Thu, Nov 24, 2011 at 1:47 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
Hello everyone!
I'm a student from the netherlands working on a parser (using cl-yacc) and I use dso-lex as the lexer-generator, which depends on cl-ppcre (as you might know). Since I want to parse RIF files that require unicode encoded characters, I wanted to extend cl-ppcre with unicode, using cl-unicode. Unfortunately I receive an error when I try to install cl-unicode. When it tries to compute the Hangul syllable names (this happens when loading hash-tables.fasl) I get the following:
Error: `("Unbound Value")' is not of the expected type `number' [condition type: type-error]
Some extra info:
- I tried to install cl-unicode with, and without installing
flexi-streams and trivial-gray-streams, but both give me the error.
- I use Allegro CL
Could you perhaps help me?
Regards,
Noldus Reijnders
PS I also get an error when it tries to load util.lisp saying that +t-count+ is unknown. However, I fixed that by replacing that with the number in the assignment of TCount. Same thing for VCount btw. Maybe that has something to do with Allegro CL?
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
Yes that would do it. :) Unfortunately that does not solve the problem. And yes, I'm working in modern mode (as in; the mode I use is case-sensitive, right?). Does that mean that mean I cannot use cl-unicode? > From: edi@weitz.de
Date: Fri, 25 Nov 2011 13:07:53 +0100 To: cl-ppcre-devel@common-lisp.net Subject: Re: [cl-ppcre-devel] Error loading cl-unicode
As for the FASL files, I was mainly concerned with the FASL files for CL-PPCRE and other libs. If all your Lisp libs are in one directory, then something like `find . -name '*.fasl' -delete' or somesuch should do it, shouldn't it?
Regarding the AllegroCL problems - are you maybe working in "modern" mode? That could definitely be a problem.
On Fri, Nov 25, 2011 at 12:51 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
Hey Edi,
Thanks for the quick response!
I tried it with CLISP together with quicklisp and that works fine (didn't know of quicklips before but it is awesome!). However when using AllegroCL, quicklips even causes additional errors: When loading lists.lisp: Error: Package "COMMON-LISP" not found. [file position = 160] [condition type: reader-error]
I also tried to install cl-unicode again without all the fasl files that were created by cl-unicode and that didn't work. Or did you really mean all fasl-files used by my AllegroCL implementation? If so, is there an easy way to do that, or do I need to remove them by hand?
Regards, Noldus
From: edi@weitz.de Date: Fri, 25 Nov 2011 10:32:28 +0100 To: cl-ppcre-devel@common-lisp.net Subject: Re: [cl-ppcre-devel] Error loading cl-unicode
Hi,
I don't have AllegroCL at hand and I don't have the time to check, but here are three things you should probably try:
- Can you try to install "from scratch" with ALL existing FASL files,
no matter where they are, deleted?
- Can you try with a different Lisp compiler and see if that works for
you?
- Did you try to install with Quicklisp to make sure that it's not a
problem of libraries not working together?
Please let us know if that helps.
Cheers, Edi.
On Thu, Nov 24, 2011 at 1:47 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
Hello everyone!
I'm a student from the netherlands working on a parser (using cl-yacc) and I use dso-lex as the lexer-generator, which depends on cl-ppcre (as you might know). Since I want to parse RIF files that require unicode encoded characters, I wanted to extend cl-ppcre with unicode, using cl-unicode. Unfortunately I receive an error when I try to install cl-unicode. When it tries to compute the Hangul syllable names (this happens when loading hash-tables.fasl) I get the following:
Error: `("Unbound Value")' is not of the expected type `number' [condition type: type-error]
Some extra info:
- I tried to install cl-unicode with, and without installing
flexi-streams and trivial-gray-streams, but both give me the error.
- I use Allegro CL
Could you perhaps help me?
Regards,
Noldus Reijnders
PS I also get an error when it tries to load util.lisp saying that +t-count+ is unknown. However, I fixed that by replacing that with the number in the assignment of TCount. Same thing for VCount btw. Maybe that has something to do with Allegro CL?
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
On Fri, Nov 25, 2011 at 1:42 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
And yes, I'm working in modern mode (as in; the mode I use is case-sensitive, right?).
Well, the usual answer to this question is that Common Lisp is always case-sensitive and that AllegroCL's "modern" mode is a strange abomination most CL hackers frown upon... :)
Does that mean that mean I cannot use cl-unicode?
I am unfortunately too busy with other things for the time being to check compatibility with AllegroCL, but I think it's very likely that CL-UNICODE won't work with modern mode out of the box. How much you'll have to change I cannot say. Maybe you'll just have to change a few lines, maybe it's something more complicated. Sorry, but I can't be more helpful with this.
Should this be the problem and should you be able to come up with patches, I'd be happy to incorporate them into a new release, though.
Haha, ok, that's too bad. Thanks for your time and if I do come up with a solution I'll be happy to inform you of it! RegardsNoldus
From: edi@weitz.de Date: Fri, 25 Nov 2011 14:26:55 +0100 To: cl-ppcre-devel@common-lisp.net Subject: Re: [cl-ppcre-devel] Error loading cl-unicode
On Fri, Nov 25, 2011 at 1:42 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
And yes, I'm working in modern mode (as in; the mode I use is case-sensitive, right?).
Well, the usual answer to this question is that Common Lisp is always case-sensitive and that AllegroCL's "modern" mode is a strange abomination most CL hackers frown upon... :)
Does that mean that mean I cannot use cl-unicode?
I am unfortunately too busy with other things for the time being to check compatibility with AllegroCL, but I think it's very likely that CL-UNICODE won't work with modern mode out of the box. How much you'll have to change I cannot say. Maybe you'll just have to change a few lines, maybe it's something more complicated. Sorry, but I can't be more helpful with this.
Should this be the problem and should you be able to come up with patches, I'd be happy to incorporate them into a new release, though.
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
Hi Noldus and Edi,
The following patch gets you most of the way there:
Common subdirectories: cl-unicode-0.1.2/build and cl-unicode-0.1.2a/build Common subdirectories: cl-unicode-0.1.2/doc and cl-unicode-0.1.2a/doc Only in cl-unicode-0.1.2a: hash-tables.lisp Only in cl-unicode-0.1.2a: lists.lisp Only in cl-unicode-0.1.2a: methods.lisp Common subdirectories: cl-unicode-0.1.2/test and cl-unicode-0.1.2a/test diff cl-unicode-0.1.2/util.lisp cl-unicode-0.1.2a/util.lisp 186c186 < (define-hangul-constant "NCount" (* +v-count+ +t-count+)) ---
(define-hangul-constant "NCount" (* +V-COUNT+ +T-COUNT+))
195,198c195,198 < (let* ((s-index (- code-point +s-base+)) < (l-value (+ +l-base+ (floor s-index +n-count+))) < (v-value (+ +v-base+ (floor (mod s-index +n-count+) +t-count+))) < (t-value (+ +t-base+ (mod s-index +t-count+)))) ---
(let* ((s-index (- code-point +S-BASE+)) (l-value (+ +L-BASE+ (floor s-index +N-COUNT+))) (v-value (+ +V-BASE+ (floor (mod s-index +N-COUNT+) +T-COUNT+))) (t-value (+ +T-BASE+ (mod s-index +T-COUNT+))))
203c203 < (and (/= t-value +t-base+) ---
(and (/= t-value +T-BASE+)
All tests pass except for
279: (string= (unicode-name 13327) "CJK UNIFIED IDEOGRAPH-340F") returned NIL
but this would work if the test used string-equal rather than string=
HTH,
Hey Gary, Thank you for the patch! Although I understand that the patch changes the lines stated below; is this something that can be applied automatically? As was most likely clear, I'm not the most experienced CL coder at the moment, so I was wondering if your text was runnable code for a program or not. Not that it isn't doable by hand but I'd like to learn the tricks of the trade! :) Regards
From: gwking@metabang.com Date: Fri, 25 Nov 2011 11:22:13 -0500 To: cl-ppcre-devel@common-lisp.net CC: support@franz.com Subject: Re: [cl-ppcre-devel] Error loading cl-unicode
Hi Noldus and Edi,
The following patch gets you most of the way there:
Common subdirectories: cl-unicode-0.1.2/build and cl-unicode-0.1.2a/build Common subdirectories: cl-unicode-0.1.2/doc and cl-unicode-0.1.2a/doc Only in cl-unicode-0.1.2a: hash-tables.lisp Only in cl-unicode-0.1.2a: lists.lisp Only in cl-unicode-0.1.2a: methods.lisp Common subdirectories: cl-unicode-0.1.2/test and cl-unicode-0.1.2a/test diff cl-unicode-0.1.2/util.lisp cl-unicode-0.1.2a/util.lisp 186c186
< (define-hangul-constant "NCount" (* +v-count+ +t-count+))
(define-hangul-constant "NCount" (* +V-COUNT+ +T-COUNT+))
195,198c195,198 < (let* ((s-index (- code-point +s-base+)) < (l-value (+ +l-base+ (floor s-index +n-count+))) < (v-value (+ +v-base+ (floor (mod s-index +n-count+) +t-count+)))
< (t-value (+ +t-base+ (mod s-index +t-count+))))
(let* ((s-index (- code-point +S-BASE+)) (l-value (+ +L-BASE+ (floor s-index +N-COUNT+))) (v-value (+ +V-BASE+ (floor (mod s-index +N-COUNT+) +T-COUNT+))) (t-value (+ +T-BASE+ (mod s-index +T-COUNT+))))
203c203
< (and (/= t-value +t-base+)
(and (/= t-value +T-BASE+)
All tests pass except for
279: (string= (unicode-name 13327) "CJK UNIFIED IDEOGRAPH-340F") returned NIL
but this would work if the test used string-equal rather than string=
HTH,
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
I mentioned the extra error when using quicklisp > it is thrown when compiling "lists.lisp", so I just opened lists.lisp in the quicklisp dist folder and the one I downloaded from your site, Edi. I found the following differences: Quicklisp:(|COMMON-LISP|::|IN-PACKAGE| :|CL-UNICODE|) (|COMMON-LISP|::|SETQ| |CL-UNICODE|::|*GENERAL-CATEGORIES*| '(|CL-UNICODE-NAMES|::|CO| etc... Edi's site:(in-package :cl-unicode) (setq *general-categories* (quote (cl-unicode-names::CO etc... Both are version 0.1.2 so I don't understand why this is, but it is clear that my CL implementation has trouble with that. I actually use "GDL" btw, which is build on top of AllegroCL and for some reason it doesn't recognise COMMON-LISP. From: n_reijnders@hotmail.com To: cl-ppcre-devel@common-lisp.net Date: Fri, 25 Nov 2011 18:34:05 +0100 CC: support@franz.com Subject: Re: [cl-ppcre-devel] Error loading cl-unicode
Hey Gary,
Thank you for the patch! Although I understand that the patch changes the lines stated below; is this something that can be applied automatically? As was most likely clear, I'm not the most experienced CL coder at the moment, so I was wondering if your text was runnable code for a program or not. Not that it isn't doable by hand but I'd like to learn the tricks of the trade! :)
Regards
From: gwking@metabang.com Date: Fri, 25 Nov 2011 11:22:13 -0500 To: cl-ppcre-devel@common-lisp.net CC: support@franz.com Subject: Re: [cl-ppcre-devel] Error loading cl-unicode
Hi Noldus and Edi,
The following patch gets you most of the way there:
Common subdirectories: cl-unicode-0.1.2/build and cl-unicode-0.1.2a/build Common subdirectories: cl-unicode-0.1.2/doc and cl-unicode-0.1.2a/doc Only in cl-unicode-0.1.2a: hash-tables.lisp Only in cl-unicode-0.1.2a: lists.lisp Only in cl-unicode-0.1.2a: methods.lisp Common subdirectories: cl-unicode-0.1.2/test and cl-unicode-0.1.2a/test diff cl-unicode-0.1.2/util.lisp cl-unicode-0.1.2a/util.lisp 186c186
< (define-hangul-constant "NCount" (* +v-count+ +t-count+))
(define-hangul-constant "NCount" (* +V-COUNT+ +T-COUNT+))
195,198c195,198 < (let* ((s-index (- code-point +s-base+)) < (l-value (+ +l-base+ (floor s-index +n-count+))) < (v-value (+ +v-base+ (floor (mod s-index +n-count+) +t-count+)))
< (t-value (+ +t-base+ (mod s-index +t-count+))))
(let* ((s-index (- code-point +S-BASE+)) (l-value (+ +L-BASE+ (floor s-index +N-COUNT+))) (v-value (+ +V-BASE+ (floor (mod s-index +N-COUNT+) +T-COUNT+))) (t-value (+ +T-BASE+ (mod s-index +T-COUNT+))))
203c203
< (and (/= t-value +t-base+)
(and (/= t-value +T-BASE+)
All tests pass except for
279: (string= (unicode-name 13327) "CJK UNIFIED IDEOGRAPH-340F") returned NIL
but this would work if the test used string-equal rather than string=
HTH,
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
_______________________________________________ cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
Gary,
Thanks for the patch. I'm a bit busy with my new job these days, but I'll eventually roll this into a new release.
Thanks again, Edi.
On Fri, Nov 25, 2011 at 5:22 PM, Gary King gwking@metabang.com wrote:
Hi Noldus and Edi,
The following patch gets you most of the way there:
Common subdirectories: cl-unicode-0.1.2/build and cl-unicode-0.1.2a/build Common subdirectories: cl-unicode-0.1.2/doc and cl-unicode-0.1.2a/doc Only in cl-unicode-0.1.2a: hash-tables.lisp Only in cl-unicode-0.1.2a: lists.lisp Only in cl-unicode-0.1.2a: methods.lisp Common subdirectories: cl-unicode-0.1.2/test and cl-unicode-0.1.2a/test diff cl-unicode-0.1.2/util.lisp cl-unicode-0.1.2a/util.lisp 186c186
< (define-hangul-constant "NCount" (* +v-count+ +t-count+))
(define-hangul-constant "NCount" (* +V-COUNT+ +T-COUNT+))
195,198c195,198 < (let* ((s-index (- code-point +s-base+)) < (l-value (+ +l-base+ (floor s-index +n-count+))) < (v-value (+ +v-base+ (floor (mod s-index +n-count+) +t-count+)))
< (t-value (+ +t-base+ (mod s-index +t-count+))))
(let* ((s-index (- code-point +S-BASE+)) (l-value (+ +L-BASE+ (floor s-index +N-COUNT+))) (v-value (+ +V-BASE+ (floor (mod s-index +N-COUNT+) +T-COUNT+))) (t-value (+ +T-BASE+ (mod s-index +T-COUNT+))))
203c203
< (and (/= t-value +t-base+)
(and (/= t-value +T-BASE+)
All tests pass except for
279: (string= (unicode-name 13327) "CJK UNIFIED IDEOGRAPH-340F") returned NIL
but this would work if the test used string-equal rather than string=
HTH,
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
Hey again!
I came across something of which I don't understand why it happens.. When I do this: (scan "[a-z]*" "<test>") I get: 0 0 #() #() while I expect: 1 4 ... ... (I don't get the registers.. Although it isn't necessary for me right now, could you maybe explain this as well if you have the time? I think it has something to do with back referencing, but I'm not sure.)
Also, when I do this:(scan "[\xD8-\xF6]*" "<test>") 0 6 #() #() while I expect to get nil.
It seems as if the scanner doesn't do anything if the first character is part of the regex in the first example (because if I add a angular bracket to the front it does find it) and in the second it matches everything while the hexcode range is far outside the strings range so it shouldn't find anything. Am I doing something wrong? Greatings, Noldus
Hi Noldus,
"*" matches zero or more occurences of the expression. Try "+" if you want to match one or more occurences.
-Hans
Hi Noldus,
What Hans says. The regex engine usually stops at the first match, so you have to be careful, because you'll get what you asked for. General questions about regular expressions are best answered by one of the numerous online articles or for example by the good O'Reilly book. I might also shamelessly recommend my "Regex Coach" application.
As for the other question: You should enter the regex string into your Lisp listener and see what you'll get back. This has something to do with how CL treats backslashes in strings - there's also a section about this in the CL-PPCRE documentation.
Cheers, Edi.
On Tue, Nov 29, 2011 at 4:51 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
Hey again!
I came across something of which I don't understand why it happens.. When I do this:
(scan "[a-z]*" "<test>")
I get: 0 0 #() #()
while I expect: 1 4 ... ... (I don't get the registers.. Although it isn't necessary for me right now, could you maybe explain this as well if you have the time? I think it has something to do with back referencing, but I'm not sure.)
Also, when I do this:
(scan "[\xD8-\xF6]*" "<test>") 0 6 #() #()
while I expect to get nil.
It seems as if the scanner doesn't do anything if the first character is part of the regex in the first example (because if I add a angular bracket to the front it does find it) and in the second it matches everything while the hexcode range is far outside the strings range so it shouldn't find anything. Am I doing something wrong?
Greatings, Noldus
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
Hi Edi and Hans,
Thanks for answering my questions. I actually already noticed the mistake with the backslashes myself, however I received a delivery failure when trying to send a mail to the mailing list about this. Thanks again for the quick help!
Noldus
From: edi@weitz.de Date: Wed, 30 Nov 2011 13:08:35 +0100 To: cl-ppcre-devel@common-lisp.net Subject: Re: [cl-ppcre-devel] strange scan results
Hi Noldus,
What Hans says. The regex engine usually stops at the first match, so you have to be careful, because you'll get what you asked for. General questions about regular expressions are best answered by one of the numerous online articles or for example by the good O'Reilly book. I might also shamelessly recommend my "Regex Coach" application.
As for the other question: You should enter the regex string into your Lisp listener and see what you'll get back. This has something to do with how CL treats backslashes in strings - there's also a section about this in the CL-PPCRE documentation.
Cheers, Edi.
On Tue, Nov 29, 2011 at 4:51 PM, Noldus Reijnders n_reijnders@hotmail.com wrote:
Hey again!
I came across something of which I don't understand why it happens.. When I do this:
(scan "[a-z]*" "<test>")
I get: 0 0 #() #()
while I expect: 1 4 ... ... (I don't get the registers.. Although it isn't necessary for me right now, could you maybe explain this as well if you have the time? I think it has something to do with back referencing, but I'm not sure.)
Also, when I do this:
(scan "[\xD8-\xF6]*" "<test>") 0 6 #() #()
while I expect to get nil.
It seems as if the scanner doesn't do anything if the first character is part of the regex in the first example (because if I add a angular bracket to the front it does find it) and in the second it matches everything while the hexcode range is far outside the strings range so it shouldn't find anything. Am I doing something wrong?
Greatings, Noldus
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
cl-ppcre-devel@common-lisp.net