Another regexp parsing question
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
per isakson
2014 年 3 月 15 日
The "+" should be after "]"
str = '.text 0x54a65b23 0x45 (hello)';
cac = regexp( str, '0x[0-9a-fA-F]+', 'match' )
returns
cac =
'0x54a65b23' '0x45'
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!