EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Parser rules regexp question

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
sepa



Joined: 06 May 2007
Posts: 13

PostPosted: Sat Nov 03, 2007 1:49 pm    Post subject: Parser rules regexp question Reply with quote

Hi.
I'm download last ec_editu from site. Then go to LexerProperties for PHP lexer -> Parser -> "String" rule
There is
Code:
(?s)"(\\"|.)*?"

As you can see (.)* don't act as needed =( Test any string:
Code:
$s="test";

I've try
Code:
(?s)".*?[^\\]"

but it's far more simple, i cant think up right regexp for PHP strings without using of parentesis.
Back to top
View user's profile Send private message Visit poster's website
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Mon Nov 05, 2007 12:34 pm    Post subject: Reply with quote

Hello,

Yes, your expression
Code:
(?s)(["']).*?[^\\]\1

is better.

Michael.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor All times are GMT
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