FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Issues with scregexp

 
Post new topic   Reply to topic     Forum Index -> scregexp
View previous topic :: View next topic  
Author Message
Linker



Joined: 06 Nov 2006
Posts: 29
Location: Almaty, Kazakhstan

PostPosted: Wed Nov 14, 2007 11:31 am    Post subject: Issues with scregexp Reply with quote

Hello.

I've stumbled upon scregexp, which turned out to be a great thing! Smile

However, regexps like "//[^\n]*" work strangely: comments say that the engine is greedy, but the match is just a "//". I experimented a bit and noticed some issues:
    How do you escape characters in regexp strings? escape twice or use wysiwyg strings (both give strange results when dealing with character classes like the one above)?
    Docs state that an expression can be in the /regexp/ form, as well as just regexp (without the forward slashes); but trying to use the second form gives strange compilation errors (out-of-bounds array access)


Your library can make my life a lot easier... Smile

I'm using DMD1.23 under Windows XP SP2. (If you need exact compilation messages, let me know.)
Back to top
View user's profile Send private message
mp4



Joined: 22 Jun 2007
Posts: 19

PostPosted: Sun Nov 18, 2007 5:44 pm    Post subject: Re: Issues with scregexp Reply with quote

I will have a look.
Back to top
View user's profile Send private message
mp4



Joined: 22 Jun 2007
Posts: 19

PostPosted: Mon Nov 19, 2007 2:31 pm    Post subject: Re: Issues with scregexp Reply with quote

Linker wrote:
Hello.

I've stumbled upon scregexp, which turned out to be a great thing! Smile

However, regexps like "//[^\n]*" work strangely: comments say that the engine is greedy, but the match is just a "//". I experimented a bit and noticed some issues:
    How do you escape characters in regexp strings? escape twice or use wysiwyg strings (both give strange results when dealing with character classes like the one above)?
    Docs state that an expression can be in the /regexp/ form, as well as just regexp (without the forward slashes); but trying to use the second form gives strange compilation errors (out-of-bounds array access)


Your library can make my life a lot easier... Smile

I'm using DMD1.23 under Windows XP SP2. (If you need exact compilation messages, let me know.)


"//[^\n]*" does not work as it denotes any empty regular expression with weird options.
Empty regular expressions are not compiled at the moment..

You need to escape both // .
This will work: "\\/\\/[^\n]*" or r"\/\/[^\n]*"

screg had also two bugs which prevented the above from running properly.
Those I have fixed. Download scregexp again.
Good Luck!


Last edited by mp4 on Fri Nov 23, 2007 5:21 am; edited 1 time in total
Back to top
View user's profile Send private message
Linker



Joined: 06 Nov 2006
Posts: 29
Location: Almaty, Kazakhstan

PostPosted: Thu Nov 22, 2007 12:33 pm    Post subject: Reply with quote

I'm grateful for your cooperation.

Thanks a lot! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> scregexp All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group