On Thu, 25 Jul 2002, lallous wrote:
> Yes, I'm aware of the strpos() or any other non-regexp string functions...
>
> but it is either I use regexp to match a certain pattern or I'll have to
> write a char-by-char parser to emulate regexp searching and yet get the
> position of the occurence!
Onc
MAIL PROTECTED]>
Sent: Thursday, July 25, 2002 7:40 AM
Subject: [PHP] preg_match() occurence position
> Hello,
>
> Can I get the starting position of my string occurence when using any
> regexps searching functions in PHP ?
>
> for example:
> $mem='this is a test'
Yes, I've done it before too...but I saw some other libraries(in other
programming langs) that has such features...
"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> on 25/07/02 11:05 PM, lallous ([EMAIL PROTECTED]) wrote:
>
> > Yes, I'm aware of
on 25/07/02 11:05 PM, lallous ([EMAIL PROTECTED]) wrote:
> Yes, I'm aware of the strpos() or any other non-regexp string functions...
>
> but it is either I use regexp to match a certain pattern or I'll have to
> write a char-by-char parser to emulate regexp searching and yet get the
> position
On Thursday, July 25, 2002, Michael Sims wrote:
> On Thu, 25 Jul 2002 15:05:36 +0200, you wrote:
>> for example:
>> $mem='this is a test';
>> preg_match('/test/', ...) should return me somehow: 10
> How about this:
> $mem='this is a test';
> if(preg_match("/(.*)test/",$mem,$matches)) {
> e
On Thu, 25 Jul 2002 15:05:36 +0200, you wrote:
> l> for example:
> l> $mem='this is a test';
> l> preg_match('/test/', ...) should return me somehow: 10
How about this:
$mem='this is a test';
if(preg_match("/(.*)test/",$mem,$matches)) {
echo strlen($matches[1]);
}
Of course, if "test" occur
Yes, I'm aware of the strpos() or any other non-regexp string functions...
but it is either I use regexp to match a certain pattern or I'll have to
write a char-by-char parser to emulate regexp searching and yet get the
position of the occurence!
Thank you all anyway.
//Elias
"Alexander Kuznet
> Can I get the starting position of my string occurence when using any
> regexps searching functions in PHP ?
>
> for example:
> $mem='this is a test';
> preg_match('/test/', ...) should return me somehow: 10
Does it have to be a regular expression you are searching for? If not,
you can use str
Hello lallous,
Thursday, July 25, 2002, 3:40:32 PM, you wrote:
l> Hello,
l> Can I get the starting position of my string occurence when using any
l> regexps searching functions in PHP ?
l> for example:
l> $mem='this is a test';
l> preg_match('/test/', ...) should return me somehow: 10
l> Tha
On Thursday 25 July 2002 20:40, lallous wrote:
> Hello,
>
> Can I get the starting position of my string occurence when using any
> regexps searching functions in PHP ?
>
> for example:
> $mem='this is a test';
> preg_match('/test/', ...) should return me somehow: 10
No.
If search string does n
Hello,
Can I get the starting position of my string occurence when using any
regexps searching functions in PHP ?
for example:
$mem='this is a test';
preg_match('/test/', ...) should return me somehow: 10
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http:
11 matches
Mail list logo