Re: reg ex help
| From: | Curt Zirzow | Date: | Fri, 04 Nov 2005 19:22:25 +0000 |
| Subject: | Re: reg ex help | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225117@lists.php.net to get a copy of this message | ||
On Fri, 04 Nov 2005 14:09:06 -0500, conditional motion wrote:
> Here is what the field content from the database would look like. I have
> removed any sensitive data.
>
> str = "Name;;;;;Grill Transom (GT302)^%%%%% -----
> Sort;;;;;Find/Replace^%%%%% ----- Calc;;;;;2568.09x^%%%%% -----
> Type;;;;;Veck^%%%%% ----- PO Number;;;;;^%%%%% ----- Previous Order
> Number;;;;;^%%%%% ----- Fabric Whole;;;;;Dyna-Dry^%%%%% ----- Fabric
> ...
If you really want a regex.. something like:
preg_match_all('/\s*([^;]+);{5}([^^]*)^/U', $str, $matches);
var_dump($matches);
And you'll have an array of field => values (excuding the Coords field).
I do wonder why this is stored in the db like this.
Curt.
--
http://news.zirzow.dyndns.org/