I need some help converting an old ereg expression to preg_match. I'm wanting to pull the barometer (altimeter) out of a airport METAR.
ereg('^(A|Q)([0-9]{4})',$part,$pieces)
The above is the expression I need to convert to preg_match. I tried this the following but it returns '0'.
preg_match('/^(A)([0-9]{4})/',$metar)
For those who are unfamiliar with a METAR, it looks like this: KLAX 230353Z 26007KT 9SM BKN009 19/16 A2985 RMK AO2 SLP105 T01890161 The altimeter is the A2985.