How would I just select a few varaibles using regexp

1 visualización (últimos 30 días)
flag = 'KLAX 312353Z 27009KT 10SM FEW200 18/10 A3007 RMK AO2 SLP182 T01780100 10217 20178 55007'
METAR changes the amount of variables usually when reported I was hoping to get someone thought on how to do this using regexp.
I was thinking about using the regexp to find A3007. I know there are other ways, but I would like to learn how to use regexp.
This is what I have so far regexp(flag, A\4[0123456789]).

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Feb. de 2017
regexp(flag, 'A\d{4}', 'match')

Más respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by