php - Need help using explode, preg_match -
I have more than a thousand reviews in the string I have been asked to see if I have average rate I can get it. Below is an example of the string I have highlighted the content that I need to extract into an array. Shepherd's Bush Empire (Times P 54 - 4 * David Sinclair ) Grizzly Bear - Sepencten Session, Hyde Park, London (Independent Proposal p17 - 4 * Elsa Brew - London (Independent Videotape p17 Tony Bennett - Albert Hall, London (Times) P 68 - 4 * Clive Davis , Standard P40 - 5 * Jack Marshal
Or any letter on *
is to blast the string, go back one character and proceed to the words.
I know that there are obstacles but they are removed later Can > P> Find a number after a star, then a word And here is an example link Show your output array like this Will Edit: Use this
preg _match_all ("/ \ d \ *? \ W *? \ W * /", $ input_lines, $ Output_array);
Array ([0] = & gt; Array [0] = & gt; 4 * David Sinclair [1] = & gt; 4 * Elisa Bray [2] = & gt; 4 * JJ [3] = & gt; 4 * Angolis Listan [4] = & gt; 4 * Clive Davis [5] = & gt; 5 * Jack Messeric))
/ \ d (\. \ D {1,2}) to add an optional decimal place? \ *? \ W *? \ W * /
Comments
Post a Comment