<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="functions" page="intro" subpage="analyze-string"/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: analyze-string</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: analyze-string"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>analyze-string</h1>
      <p>Analyzes a string using a regular expression, returning an XML structure that
            identifies which parts of the input string matched or failed to match the regular expression,
            and in the case of matched substrings, which substrings matched each capturing group in the
            regular expression.</p>
      <p class="subhead">analyze-string($input as xs:string?, $pattern as xs:string) &#8594; element(fn:analyze-string-result)</p>
      <table>
         <tr>
            <td width="470" align="left" colspan="4" style="border-top:solid 1px #3D5B96; ">
               <p>
                     <i>Arguments</i>
                  </p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$input</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string?</p>
            </td>
            <td valign="top" width="200">
               <p>The input string</p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$pattern</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string</p>
            </td>
            <td valign="top" width="200">
               <p>A regular expression</p>
            </td>
         </tr>
         <tr>
            <td colspan="2"
                style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;">
               <p>
                     <i>Result</i>
                  </p>
            </td>
            <td style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;"
                colspan="2">
               <p>element(fn:analyze-string-result)</p>
            </td>
         </tr>
      </table>
      <p class="subhead">analyze-string($input as xs:string?, $pattern as xs:string, $flags as xs:string) &#8594; element(fn:analyze-string-result)</p>
      <table>
         <tr>
            <td width="470" align="left" colspan="4" style="border-top:solid 1px #3D5B96; ">
               <p>
                     <i>Arguments</i>
                  </p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$input</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string?</p>
            </td>
            <td valign="top" width="200">
               <p>The input string</p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$pattern</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string</p>
            </td>
            <td valign="top" width="200">
               <p>A regular expression</p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$flags</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string</p>
            </td>
            <td valign="top" width="200">
               <p>Flags controlling the interpretation of the regular expression</p>
            </td>
         </tr>
         <tr>
            <td colspan="2"
                style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;">
               <p>
                     <i>Result</i>
                  </p>
            </td>
            <td style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;"
                colspan="2">
               <p>element(fn:analyze-string-result)</p>
            </td>
         </tr>
      </table>
      <p class="subhead">Links to W3C specifications</p>
      <p>Namespace: http://www.w3.org/2005/xpath-functions</p>
      <p>Applies to: XPath 3.0, XSLT 3.0, XQuery 3.0 (if enabled in Saxon: requires Saxon-PE or Saxon-EE)</p>
      <p>
            <a href="http://www.w3.org/TR/xpath-functions-11/#func-analyze-string"
            class="bodylink">XPath 3.0 Specification</a>
         </p>
      <p class="subhead">Notes on the Saxon implementation</p>
      <p>New in Saxon 9.3</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="asin.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>