The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you ?
Author Message
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #1
How do you ?
Hei guys, this one is embarrassing, how do you chenk, if string contains numbers and/org letters and / or spaces ? I really can't figure this one out Sad Iam sorry for dumb question...
(This post was last modified: 04-09-2013 02:42 AM by Dullais.)
04-09-2013 02:32 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: How do you ?

[Image: 2nis46r.jpg]
04-09-2013 03:39 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #3
RE: How do you ?
(04-09-2013 03:39 AM)Mordaunt Wrote:  http://wiki.sphere.torfo.org/index.php/C...0#STRMATCH

Thank you man, but i already drilled this and i just cant get it... how do i combine ? And what are thoes simbols in exaple ? what do they mean ? What the hell is this ? - ^[-+]? Its not sad in spherewiki...
Beleve me, i try myself first, and if i cant get, i come to ask you guys Smile not Other way around...
04-09-2013 03:54 AM
Find all posts by this user Like Post Quote this message in a reply
Pidrila
Apprentice
*

Posts: 36
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2013
Reputation: 0



Post: #4
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
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #5
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
Find all posts by this user Like Post Quote this message in a reply
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #6
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 Big Grin

(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 Smile Thanks for that Smile
(This post was last modified: 04-09-2013 07:10 PM by Dullais.)
04-09-2013 07:03 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)