I need some help in changing an old ERR expression to preg_match. I am the barometer from the airport METAR (altimeter ).
ereg ('^ (a | q) ([0- 9] {4})', $ part, $ pieces) expression above I need to convert to preg_match. I tried it for the following, but it gives '0'.
preg_match ('/ ^ (A) ([0- 9] {4}) /', $ metar) Unrecognized persons of MATAR For, it seems: Clax 230353 J 26007 KT9 SM BKN 2009 9/16 A2 99 85 RMK AO SLP105 T01890161 is the Ultimate A2985 .
You must remove the initial anchor ^ if (preg_match ('/ ([AQ]) ([0- 9] {4}) /', $ meter, $ match) print_r ($ match); Note that for more security, you can add word limits:
if (preg_match ('/ \ b ([AQ]) ([0- 9] {4}) \ B / ', $ meter, $ match) print_r ($ match);
No comments:
Post a Comment