- https://www.mathworks.com/matlabcentral/answers/37211-matlab-extract-url-from-html-source
- https://www.mathworks.com/matlabcentral/answers/343912-how-to-select-specific-urls-in-a-webpage-with-regexp
- https://www.mathworks.com/matlabcentral/answers/454226-help-with-regexp-extracting-info-from-a-fragment-of-url-inside-the-html-code
Extract just URL using Regular Expressions
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello everyone, does anyone of you know how to extract just the urls? x should provide a 1X3 cell array containing: {'www.lichess.org'} {'www.bing.com'} {'www.google.com'}
regularexpression = '';
script = ['I <I>used</I> <B>to</B> visit <THE> website <A HREF=www.lichess.org>twice a day</A>. ' ...
'Visit <I>the website</I> <A HREF=www.bing.com>or alternatively</A> just <A HREF=www.google.com> for more information</A>.']
x = regexp(script,regularexpression,'match')
댓글 수: 0
답변 (1개)
Arjun
2025년 2월 3일
In order to extract only URL's from a given text or scripts, you can construct regular expressions and then match them using "regexp" function in MATLAB.
You can refer to the following related resources for constructing your own regular expression based on your requirements:
Additionally, refer to this documentation link to have better understanding about the process of building a regular expression: https://www.mathworks.com/help/matlab/matlab_prog/regular-expressions.html
I hope this will help!
댓글 수: 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!