I've improved the expression to this:
Code:
<\s*(w:p)(\s+[^>]*>)|(\s*>)([^[<\s*\/\s*(w:p)\s*>]]*)<\s*\/\s*(w:p)\s*>
This expression is giving me the full w:p tag and closing tag i.e. <w:p id=23 class="..." etc="ugotthepoint"> in one match and </w:p> in another match. I am not however getting the content in between the two tags. The content is showing up in my match as "" (null). This is with preg (in PHP).
EDIT: Just for clarification the (\s+[^>]*>)|(\s*>) prevents tags similiar to w:p from being matched such as w:pPr.
EDIT: I don't think anyone is actually reading this but I've modified my expression to this:
Code:
#<\s*(w:p)\s*[^(\/>)]*>([^(<\/\1>)]*)<\s*\/\1\s*>#is