0

I would like to get the "MyDocType" string/value of the following string using regex. Yes, it is an XML node, but I really need to get it using regex! :)

  <cmis:propertyString propertyDefinitionId="ctp:DocType" displayName="document type" queryName="ctp:DocType"><cmis:value>MyDocType</cmis:value></cmis:propertyString>

Please note the I may have other matches. I want all. Also, there are other tags in the string, but the following rules may be sufficient to get the string:

  1. starts with:

  2. it has some text between

  3. but the value is between the <cmis:value> tags.

I can't just look at the <cmis:value> tags because there are occurrences of it in other places that I don't want to match.

Finally, I need to get the link after the href=" text. I can also have many.

<link rel="self" href="http://localhost:8080/alfresco/s/cmis/s/workspace:SpacesStore/i/6c0dc826-179b-4ed6-9c3a-300f45d6556b"/>

thank you very much!

Miguel

user3643038
  • 143
  • 12
  • 1
    *"...but I really need to get it using regex..."* ***Why?*** Why do you beleive you have to use the wrong tool for the job? – T.J. Crowder Jul 20 '16 at 15:54
  • 1
    [Obligatory link](http://stackoverflow.com/a/1732454/157247) (yes, it applies to XML, too). – T.J. Crowder Jul 20 '16 at 15:55
  • When you were asking your question, there was a big orange **How to Format** box to the right of the text area with useful information in it. There was also an entire toolbar of formatting aids. And a **[?]** button giving formatting help. *And* a preview area located between the text area and the Post Your Question button (so that you'd have to scroll past it to find the button, to encourage you to look at it) showing what your post would look like when posted. Making your post clear improves your chances of getting good answers. I've fixed the formatting for you this time. – T.J. Crowder Jul 20 '16 at 15:57
  • Did you try something? Why don't you use a xml parser? – Federico Piazza Jul 20 '16 at 15:58
  • What xml parser? WIll it work in different browsers? – user3643038 Jul 20 '16 at 16:24

0 Answers0