Wow, I never even knew about this function! Very intuitive and seems to work just as well as regexp. Are there any benefits to using extractBetween other than the fact that it's more easy to use for this purpose?
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
6 Comments
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723758
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723758
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723761
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723761
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723763
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723763
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723766
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723766
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723846
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723846
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723866
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/471404-how-to-remove-everything-from-string-except-what-s-inside-square-brackets#comment_723866
Sign in to comment.