Another regexp parsing question
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Duke
am 15 Mär. 2014
Beantwortet: per isakson
am 15 Mär. 2014
I have a string with 2 hex values like:
'.text 0x54a65b23 0x45 (hello)'
I want to pull the full hex numbers out of this string. Like my last question I just can't get it right. I can get the '0x' part of each number but I can't get the full string. I tried a lot of different varitions of this '0x[1234567890abcdef]'. I've tried doing '+' and '*' after each character but it refuses to get the numbers after the 0x. Thanks!
0 Kommentare
Akzeptierte Antwort
per isakson
am 15 Mär. 2014
The "+" should be after "]"
str = '.text 0x54a65b23 0x45 (hello)';
cac = regexp( str, '0x[0-9a-fA-F]+', 'match' )
returns
cac =
'0x54a65b23' '0x45'
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu String Parsing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!