php preg_match_all - exclude some matches

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

 



Hello. Is this php group JUST for development progress for PHP ? or
can we ask questions here ? it's the only PHP forum I'm on.

I've used preg_match quite a bit, but am unfamiliar with preg_match_all.

Ive not started yet, but I'm going to design a script with a 500Kb
input  text-file, which i want to use preg_match_all on.

Q. i guess 500Kb in a HTML form in $_POST format isn't too much ? Is it Ok ?

In development, I'm going to scan through the data/array & see the
lines Ive captured for possible exclude text, but even looking at the
raw data, I see lines I want to EXCLUDE from the results.
In the live version, I'll use it but have some excluded patterns.

I have these example lines I want to exclude. (inner patterns).

"type":"WORD1"
"type":"WORD2"
"type":"WORD3"

Q. Is there a way to use preg_match_all to extract text by an outer
preg criteria, but if the extracted text also matches one of the
chosen inner-patterns, it is NOT included in the results.

Can I do this in one go ? Or will I need to do a foreach loop in the
results to exclude / remove any unwanted sub-patterns after.

I'm not sure yet, but I expect the "wanted" text to be 10-20% of the
original text.


-- 

Gordon.



[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