Who can help me extract the following three pieces of data using regular expressions in the following code? First, in alt = & quot; Mico & quot;, the second is: & lt; spanclass = & quot; imo & quot; & gt; 7732078 & lt; /span & gt sincerely ask for regular expressions
Who can help me extract the following three pieces of data using regular expressions in the following code?
First, alt = "Mico" in the Mico
2: 7732078 in 7732078
Third: A 14 in A 14
7732078
A 14
7528398
A 15
Thank you.
------ Solution --------------------
PHP code
A 14 7528398
A 15 HTML; preg_match_all ('/alt = "(.*?) "| Class =" imo "> (.*?) <| Vessel-name "> (.*?) ------ Solution --------------------
$ Re1 = '/alt = "[a-zA-Z] * [^"]/I ';
$ Re2 = '/\ d * [^ \ <]/I ';
$ Re3 = '/[a-zA-Z0-9] * [^ \ <]/I ';
$ Match = '';
Preg_match_all ($ re1, $ str, $ match );
Echo'';
Print_r ($ match );
The first $ re1 has a problem. you have to think about it.