Re: [PHP] preg_match() occurence position

2002-07-25 Thread Miguel Cruz
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

Re: [PHP] preg_match() occurence position

2002-07-25 Thread Tech Support
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'

Re: [PHP] preg_match() occurence position

2002-07-25 Thread lallous
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

Re: [PHP] preg_match() occurence position

2002-07-25 Thread Justin French
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

Re: [PHP] preg_match() occurence position

2002-07-25 Thread Tim Fountain
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

Re: [PHP] preg_match() occurence position

2002-07-25 Thread Michael Sims
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

Re: [PHP] preg_match() occurence position

2002-07-25 Thread lallous
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

RE: [PHP] preg_match() occurence position

2002-07-25 Thread John Holmes
> 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

Re: [PHP] preg_match() occurence position

2002-07-25 Thread Alexander Kuznetsov
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

Re: [PHP] preg_match() occurence position

2002-07-25 Thread Jason Wong
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

[PHP] preg_match() occurence position

2002-07-25 Thread lallous
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: