Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How to use regexp with a string correctly
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
flag = 'KLAX 312353Z 27009KT 10SM FEW200 18/10 A3007 RMK AO2 SLP182 T01780100 10217 20178 55007'
I need to find extract 312352Z from the string using I tried regexp(flag, '\d{4}\Z', 'match');
I am sure the syntax is not correct. What is the correct syntax? Thanks in advance.
0 comentarios
Respuestas (1)
Star Strider
el 2 de Feb. de 2017
You need to tell regexp that you’re looking for the beginning and ending of a particular word:
wx_time = regexp(flag, '\<\d*Z\>', 'match')
wx_time =
cell
'312353Z'
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!