You are here: regular expression inquiry « PHP Programming Language « IT news, forums, messages
regular expression inquiry

Posted by vito on 05/05/06 12:03

I have a text file (see below please) to parse with the following code. i
don't know why it cannot match anything. thanks.


$data=fread(fopen("$dir/$file","r"),filesize("$dir/file"));

$matchno = preg_match_all("|.*:(.+)\n$|U", $data, $reg);

for ($i=1; $i<$matchno; $i++) {
$line = ",'".trim($regs[1][$i]."'");
fwrite($fp, $line);
}


GROUP: CARS R/C SERIES

PRODUCT
NAME: R/C CAR

PACKAGE: WINDOW BOX

SIZE:30.5‘Α12‘Α10.6 cm

MEAS:84* 34*93 cm

PCS/CTN: 48 pcs

GROSS
WEIGHT: NIL

NET
WEIGHT: NIL

INNER
BOX QTY: NIL

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация