Mordaunt
Super Moderator
Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35
|
RE: How do you ?
|
|
04-09-2013 03:39 AM |
|
|
Pidrila
Apprentice
Posts: 36
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2013
Reputation: 0
|
RE: How do you ?
for spaces here is an example like spherewiki shows :
Code:
IF (STRMATCH(*ex*, <ARGS>))
// will explain the (*ex*, <ARGS>) // *ex* - * is space, ex word, * - space! <ARGS> the words what player is typing..
|
|
04-09-2013 05:31 AM |
|
|
RanXerox
Master
Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19
|
RE: How do you ?
What you probably don't understand is the concept of "regular expression"... if so, check this out: http://en.wikipedia.org/wiki/Regular_expression
A regular expression for "string contains numbers and/org letters and / or spaces" is impossible... make up your mind, is it AND or OR or both ;-)
An example Sphere IF statement that uses a regular expression to validate "string ONLY contains numbers or letters or spaces" would look like this:
Code:
if ( strregex(^[A-Za-z0-9 ]+$,<local.string>) )
(This post was last modified: 04-09-2013 08:13 AM by RanXerox.)
|
|
04-09-2013 08:12 AM |
|
|
Dullais
Journeyman
Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0
|
RE: How do you ?
(04-09-2013 05:31 AM)Pidrila Wrote: for spaces here is an example like spherewiki shows :
Code:
IF (STRMATCH(*ex*, <ARGS>))
// will explain the (*ex*, <ARGS>) // *ex* - * is space, ex word, * - space! <ARGS> the words what player is typing..
Thanks man, but...
Tu jau zini kā ir ar to video par latviešu valodu, kad 2 latvieši satiekas, un sarunājas krievieski. Mums te ir sanācis apmēram tas pats
(04-09-2013 08:12 AM)RanXerox Wrote: What you probably don't understand is the concept of "regular expression"... if so, check this out: http://en.wikipedia.org/wiki/Regular_expression
A regular expression for "string contains numbers and/org letters and / or spaces" is impossible... make up your mind, is it AND or OR or both ;-)
An example Sphere IF statement that uses a regular expression to validate "string ONLY contains numbers or letters or spaces" would look like this:
Code:
if ( strregex(^[A-Za-z0-9 ]+$,<local.string>) )
Thanks man, wikipedia page did really explain to me, what does thoes +^. an other means, So now everything is about right Thanks for that
(This post was last modified: 04-09-2013 07:10 PM by Dullais.)
|
|
04-09-2013 07:03 PM |
|
|