<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>select(String,String,String) -- select substrings matching a regular expression from a string</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_horizontal__Join.html">next</a> | <a href="_select_lp__String_cm__String_rp.html">previous</a> | forward | <a href="_select_lp__String_cm__String_rp.html">backward</a> | <a href="_regular_spexpressions.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <div><a href="index.html" title="">Macaulay2Doc</a> > <a href="___The_sp__Macaulay2_splanguage.html" title="">The Macaulay2 language</a> > <a href="_strings_spand_spnets.html" title="">strings and nets</a> > <a href="_regular_spexpressions.html" title="">regular expressions</a> > <a href="_select_lp__String_cm__String_cm__String_rp.html" title="select substrings matching a regular expression from a string">select(String,String,String)</a></div> <hr/> <div><h1>select(String,String,String) -- select substrings matching a regular expression from a string</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>select(p,r,s)</tt></div> </dd></dl> </div> </li> <li><span>Function: <a href="_select.html" title="select from a list, hash table, or string">select</a></span></li> <li><div class="single">Inputs:<ul><li><span><tt>p</tt>, <span>a <a href="___String.html">string</a></span>, a regular expression describing a pattern</span></li> <li><span><tt>r</tt>, <span>a <a href="___String.html">string</a></span>, a replacement string</span></li> <li><span><tt>s</tt>, <span>a <a href="___String.html">string</a></span>, a subject string to be searched</span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___List.html">list</a></span>, the list with one entry for each substring of <tt>s</tt> matching <tt>p</tt>, obtained from <tt>r</tt> by replacing each occurrence of a backslash and a digit by the string matching the corresponding parenthesized subexpression of <tt>p</tt></span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><table class="examples"><tr><td><pre>i1 : select("([a-z]+);","\\1","dog; cat, deer;") o1 = {dog, deer} o1 : List</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_select_lp__String_cm__String_rp.html" title="select substrings matching a regular expression from a string">select(String,String)</a> -- select substrings matching a regular expression from a string</span></li> <li><span><a href="_regular_spexpressions.html" title="">regular expressions</a></span></li> </ul> </div> </div> </body> </html>