Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Yara
Newbie


Joined: 24 Mar 2005
Posts: 1

PostPosted: Thu Mar 24, 2005 8:40 pm   

%regex not case sensitive?
 
Hey there,

how can I test, if a string starts with a capital letter? I tried to use %regex,
but that doesn't seem to be case sensitive,

%regex( "Test", [a-z])
and
%regex( "Test", [A-Z])

_both_ result in '1'. Same with %match.

Thanks for help
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu Mar 24, 2005 9:01 pm   
 
#IF ("Test"=%proper("test")) {#ECHO Yup!}
Reply with quote
Ins0mniak
Apprentice


Joined: 27 Apr 2001
Posts: 110

PostPosted: Fri Mar 25, 2005 6:38 pm   
 
Maelstrom wrote:
#IF ("Test"=%proper("test")) {#ECHO Yup!}
That will probably take care of the situation above, but I'm actually in the situation of needing to test a unknown string to see if there is a capital letter in the middle of it. I don't understand why %regex isn't case sensitive...

Neither of these work correctly:

%regex(@SomeString,"[A-Z]\w+[A-Z]\w+")

OR

%regex(@SomeString,"[A-Z]\w+[^a-z]\w+")

:-(
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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

© 2009 Zugg Software. Hosted by Wolfpaw.net