title: select the word preceding the number
body: <p>I've the below XML data.</p>
  
  <pre><code>&lt;para&gt;The functions and duties of the CCS set out in s 6 CA are focused on promoting efficient market conduct and competitiveness of markets in Singapore. Consumer welfare, mentioned in the Singapore&amp;#8211;US FTA, is not expressly mentioned as a purpose of the CA, nor is it expressly set out in the CA as an objective to be safeguarded by the CCS. However, CCS Guideline 1, at para 2.1 on &amp;#8220;Purpose&amp;#8221; of the CA makes reference to how consumers benefit as a consequence of competition. And this is equal to 2.1% of the entire data&lt;/para&gt;&lt;/footnote&gt;&lt;/para&gt;&lt;/item&gt;
  </code></pre>
  
  <p>Here i want to capture the number followed by the word <code>para</code> or <code>paras</code> or <code>paras 1.2 and 0.8</code> but it should not capture if the data is like <code>general 1.2 and 1.3</code></p>
  
  <p>the regex i use is as below.</p>
  
  <pre><code>    &lt;xsl:template match="text()"&gt;
  
      &lt;xsl:analyze-string select="." regex="(([Cc]hapter)\s(\d+))"&gt;
  
          &lt;xsl:matching-substring&gt;
              &lt;xsl:choose&gt;
                  &lt;xsl:when test="number(regex-group(3)) &amp;lt; number(9)"&gt;
                      &lt;a href="{concat('er:#BGCL_CH_',format-number(number(regex-group(3)),'00'),'/','BGCL_CH_',format-number(number(regex-group(3)),'00'))}"&gt;
                          &lt;xsl:value-of select="."/&gt;
                      &lt;/a&gt;
                  &lt;/xsl:when&gt;
                  &lt;xsl:otherwise&gt;
                      &lt;xsl:value-of select="."/&gt;
                  &lt;/xsl:otherwise&gt;
              &lt;/xsl:choose&gt;
  
          &lt;/xsl:matching-substring&gt;
  
          &lt;xsl:non-matching-substring&gt;
              &lt;xsl:analyze-string select="." regex="([0-9]+)\.([0-9]+)"&gt;
  
                    &lt;xsl:matching-substring&gt;
           &lt;xsl:choose&gt;
                                                                  &lt;xsl:when test="number(regex-group(1)) &amp;lt; number(9)"&gt; 
                                                                  &lt;a
            href="{concat('er:#CLI_CH_',format-number(number(regex-group(1)),'00'),'/P',format-number(number(regex-group(1)),'0'),'-',format-number(number(regex-group(2)),'000'))}"&gt;
            &lt;xsl:value-of select="."/&gt;
          &lt;/a&gt;
          &lt;/xsl:when&gt;
          &lt;xsl:otherwise&gt;
  </code></pre>
  
  <p><br>
              
                                                                  
            
                      </p>
  
  <pre><code>                    &lt;xsl:analyze-string select="."  regex="http://[^ ]+"&gt;
                          &lt;xsl:matching-substring&gt;
                              &lt;a href="{.}"&gt;
                                  &lt;xsl:value-of select="."/&gt;
                              &lt;/a&gt;
  
                          &lt;/xsl:matching-substring&gt;
                          &lt;xsl:non-matching-substring&gt;
  
                              &lt;xsl:value-of select="."/&gt;
                          &lt;/xsl:non-matching-substring&gt;
                      &lt;/xsl:analyze-string&gt;
                  &lt;/xsl:non-matching-substring&gt;
              &lt;/xsl:analyze-string&gt;
          &lt;/xsl:non-matching-substring&gt;
      &lt;/xsl:analyze-string&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>but here it is capturing any number in <code>x.y</code> format, and i want to capture only if the text is in the following formats</p>
  
  <pre><code>para x.y
  paras x.y and x.y
  </code></pre>
  
  <p>and i want to convert the <code>x.y</code> into the below format </p>
  
  <pre><code>er:#BGCL_CH_x/Px-y
  </code></pre>
  
  <p>please let me know how can i do this.</p>
  
  <p>Thanks</p>