Need RegEx Guru Help...
| From: | Matthew Boehm | Date: | Tue, 13 Jun 2000 16:44:56 +0000 |
| Subject: | Need RegEx Guru Help... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-1729@lists.php.net to get a copy of this message | ||
I have the following perl regexes that I am having trouble converting
into
PHP. I have even tried using the preg_split to no avail.
Could someone please help? Or if there is a site you know of that can
help
convert perl regex to PHP, could you pass it along?
Thanks,
Matthew
$start = '-\*([a-zA-Z\-0-9]+)\*-\s';
$t = '\*\*';
$s = '\s\s';
$d = '(\d+)';
# Regular expression variables
$match_stats0 = qr(${start}\[\*\sStat\s\*]\s$d\sfiles?\.\s\s$d\sof\s$d\sslots?\sopen);
$match_stats1 = qr($start$t\s$d\spacks?\s$t$s$d\sof\s$d\sslots\sopen,\sRecord:\s(.*));
$match_stats2 =
qr($start$t\s$d\spacks?\s$t$s$d\sof\s$d\sslots\sopen,\s(Max|Min):\s(.+),\sRecord:\s(.*));
$match_stats3 = qr($start$t\s$d\spacks?\s$t$s$d\sof\s$d\sslots\sopen,\sQueue:\s(\d+)/(\d+));
$match_bandwidth1 = qr($start$t\sBandwidth\sUsage\s$t\sCurrent:\s(.*),\sCap:\s(.*),\sRecord:\s(.*));
$match_bandwidth2 = qr($start$t\sBandwidth\sUsage\s$t\sCurrent:\s(.*),\sRecord:\s(.*));
$match_pack = qr($start\#$d\s+${d}x\s+\[\s*(.+?)\]\s+(.*));
$match_note = qr($start\s\^-\s+(.*));
$match_totals = qr(${start}Total\sOffered:\s(.*)${s}Total\s(?:Transferred|Snagged):\s(.*));