Results 1 to 4 of 4
Aug 14, 2013, 17:18 #1
- Join Date
- Apr 2012
- 0 Post(s)
- 0 Thread(s)
Find similar patterns and extract data
I'm trying to extract "three" and/or "(3)" from all of these patterns. The strings are never the same size and the words are sometimes incorrect, so I can't do an easy preg_match syntax on it.
There are a lot of similar words that proceed the string though. A perfect sentence is "PRIMARY TERM: This leaseshall remain in force for a primary term of three (3) years from the effective date hereof, and as long thereafter..."
My initial thoughts are to use similar_text and preg_match, but I haven't thought up a good way just yet. Any ideas how this could be done?
$String = '.... remain in force for a primy term OL three (3) years from the effective date hereof, and as lo....';
$String2 = '.... *JE~ in force for a primary torm of three (*B years from the effective date hereof, .......';
$String3 = '.... remain in farce for a primary term OL threA (3 years from the effective date hereof, and as lo....';