- Scilab Online Help
- Strings
- ascii
- blanks
- code2str
- convstr
- emptystr
- eval
- evstr
- grep
- isalphanum
- isascii
- isdigit
- isletter
- isnum
- justify
- length
- part
- regexp
- sci2exp
- str2code
- strcat
- strchr
- strcmp
- strcmpi
- strcspn
- strindex
- string
- strings
- stripblanks
- strncpy
- strrchr
- strrev
- strsplit
- strspn
- strstr
- strsubst
- strtod
- strtok
- tokenpos
- tokens
- tree2code
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
regexp
find a substring that matches the regular expression string
Calling Sequence
[start]=regexp(input,pattern,[flag]) [start,end,match]=regexp(input,pattern,[flag]) [start,end]=regexp(input,pattern,[flag]) [start,end,match]=regexp(input,pattern,[flag])
Arguments
- input
a string.
- pattern
a character string (under the rules of regular expression)
- start
the starting index of each substring of str that matches the regular expression string pattern
- end
the ending index of each substring of str that matches the regular expression string pattern
- match
the text of each substring of str that matches
pattern
.- [flag]
'o' for matching the pattern once .
Description
The rules of regular expression are similar to perl language. For a quick start , see http://perldoc.perl.org/perlrequick.html. For a more in-depth tutorial on , see http://perldoc.perl.org/perlretut.html and for the reference page, see http://perldoc.perl.org/perlre.html
A difference with Perl is that matching a position but no character (for example, with /^/ or /(?=o)/) is a successful match in Perl but not in Scilab.
Examples
regexp('xabyabbbz','/ab*/','o') regexp('a!','/((((((((((a))))))))))\041/') regexp('ABCC','/^abc$/i') regexp('ABC','/ab|cd/i') [a b c]=regexp('XABYABBBZ','/ab*/i')
See Also
<< part | Strings | sci2exp >> |