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 of Mico: & lt; spanclass & quot; imo & quot; & gt; 7732078 & lt; span & gt;, the third of Mico: & lt; spanclass & quot; vessel-name & quot 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
7732078
A 14 7528398
A 15HTML; 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.