I am trying to match a DTD node such as this text:
<!ELEMENT note (to,from,body)>
With this regular expression:
match(/<!ELEMENT\s?(.*?)\s?\(.*?\)>/i)
and it returns the desired text + the text 'note' -can anyone explain why?
Also, when I remove either or both of the blank spaces either side of the 'note' text it still returns the result, and this is not wanted. Can anyone help explain why it is doing that too?
Here is my test file:
<!ENTITY Aring "&#197;" >,
<!ENTITY aring "&#229;" >,
<!ENTITY agrave "&#224;" >,
<!ENTITY aacute "&#225;" >,
<!ATTLIST ARTICLE AUTHOR CDATA #REQUIRED>,
<!ATTLIST ARTICLE EDITOR CDATA #IMPLIED>,
<!ATTLIST ARTICLE DATE CDATA #IMPLIED>,
<!ATTLIST ARTICLE EDITION CDATA #IMPLIED>,
<!ELEMENT note (to,from,heading,body)>,
<!ELEMENT to (#PCDATA)>,
<!ELEMENT from (#PCDATA)>,
<!ELEMENT heading (#PCDATA)>,
<!ELEMENT body (#PCDATA)>
Thanks in advance for any help!