Invalid option for regexpi: (unit8|unit16).
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone,
does anyone know what this error means:
Error using regexpi
Invalid option for regexpi: (unit8|unit16).
Thanks in advanced!
댓글 수: 5
Rik
2021년 3월 22일
Well, in that case I can't help you unless you provide more details about how you call regexpi.
답변 (1개)
Arun
2024년 2월 16일
Hey Blanca,
I understand that you need an explanation regarding the error “Error using regexpi Invalid option for regexpi”.
“regexpi” function is used for matching case insensitive regular expression. The error message suggests that (unit8|unit16) is included as an option or outkey, which is an invalid option resulting in the error.
Here is a sample code for reference that reproduces the same error:
try
str = 'Sample text to search';
pattern = 'text';
regexpi(str, pattern, '(unit8|unit16)');
catch ME
disp(ME.message);
end
Alternatively, refer the below sample code, here the “match” variable will contain the starting indices of any matches found for ‘unit8’ or ‘unit16’ regardless of case within “target_string”:
% Assuming you want to match 'unit8' or 'unit16' in a case-insensitive manner
target_string = 'This is an example string with unit8 and UNIT16.';
expression = '(unit8|unit16)';
matches = regexpi(target_string, expression)
Make sure that any options and outkey that pass to “regexpi” are valid. Some common options include “start”, “end”, “tokenExtents”, “match”, tokens”, “names”, and “split”.
For more information related to “regexpi” please refer the MATLAB documentations link: https://www.mathworks.com/help/matlab/ref/regexpi.html
I hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!