next
|
previous
| forward |
backward
|
up
|
top
|
index
|
toc
|
home
Macaulay2
>
The Macaulay2 language
>
strings and nets
>
regular expressions
>
select(String,String,String)
select(String,String,String) -- select substrings matching a regular expression from a string
Synopsis
Usage:
select(p,r,s)
Function:
select
Inputs:
p
,
a
string
, a regular expression describing a pattern
r
,
a
string
, a replacement string
s
,
a
string
, a subject string to be searched
Outputs:
a
list
, the list with one entry for each substring of
s
matching
p
, obtained from
r
by replacing each occurrence of a backslash and a digit by the string matching the corresponding parenthesized subexpression of
p
Description
i1 : select("([a-z]+);","\\1","dog; cat, deer;") o1 = {dog, deer} o1 : List
See also
select(String,String)
-- select substrings matching a regular expression from a string
regular expressions