2

I have a string in xml file "This is a subpara (10.1), subpara (1)"

I want to know the regex expression which find the word "subpara" followed by a "space" followed by a "(" and one or more "digits" and optionally followed by a "." and one or more digits followed by ")".

I tried using the following but not getting the desire result:

<xsl:analyze-string select="." regex="subpara [\(\d+(\.\d+)?\)]+">
2
  • What programming language are you using? Regexp probably isn't a good fit here. Commented Mar 28, 2012 at 16:26
  • i am using xslt 2.0 with <xsl:analyze-string> Commented Mar 28, 2012 at 17:31

2 Answers 2

2

Here you go:

regex="(subpara \(\d+(\.\d+)?\))"
Sign up to request clarification or add additional context in comments.

Comments

1

I managed to get it working using

<xsl:analyze-string select="." regex="subpara\s\(\d+(\.\d+)?\)">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.