Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #15898

Re: find a space in a string, better fast solution?

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.php
Subject Re: find a space in a string, better fast solution?
Date 2015-11-14 13:08 +0100
Organization PointedEars Software (PES)
Message-ID <2535573.JF6dglbBag@PointedEars.de> (permalink)
References <n2744a$2v9$1@speranza.aioe.org>

Show all headers | View raw


albert wrote:

> which is the most fast solution for know if after first number there is
> a space?

Pattern matching: <http://php.net/preg_match>

If the function returns 0 for the proper pattern, there either is no number 
or there is no number followed by space.

If it returns 1 then, there is a number followed by space.

For the first number, all preceding characters (in the line) must be non-
digits.  That can either be addressed with a negating *character class* (see 
the corresponding section in the PHP manual) or with negative *lookbehind* 
(see the section “Assertions”).

-- 
PointedEars
Zend Certified PHP Engineer
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

find a space in a string, better fast solution? albert <alstopspam@stopaspam.com> - 2015-11-14 11:58 +0100
  Re: find a space in a string, better fast solution? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-11-14 13:08 +0100
  Re: find a space in a string, better fast solution? Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-14 09:18 -0500

csiph-web