How to find specific text in a string?
显示 更早的评论
Hello,
I have the following text:
"abs(3).def(5).hhh(11)"
Is there an easy way for search for all the locations with "(" - number - ")".
I mean, all the places where there is a number between parenthesis.
I've try to use regexp but it was too complicate for me to understand how exactly it should be written.
Thanks.
1 个评论
Fangjun Jiang
2022-4-4
regular expression makes you relax :)
采纳的回答
更多回答(1 个)
Fangjun Jiang
2022-4-4
0 个投票
a="abs(3).def(5).hhh(11)";
regexp(a,'(\d+)')
类别
在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!