Re: PHP script for detecting pattern sequences?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rob Gould wrote:

> Can anyone tell me if there's a PHP library out there that will help
> me determine "pattern sequences" from a string?
> 
> 
> Example input:
> 
> 032258064516129032258064516129032258064516129032258064516129
> Sequence = 032258064516129
> 
> 
> 037037037037037037037037037037037037037037037037037037037037
> Sequence = 037
> 
> 
> I know regex can help you find a pattern when you know what the
> pattern is already, but this is different.

Nah, it's the same thing. 

A suitable regex might look something like this:

/([0-9]+)\1+/

Not tested, probably won't work on the first try.  You may need
greediness adjustments. 


/Per


-- 
Per Jessen, Zürich (14.1°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux