I am trying to use a regular expression to find only the first element in set. For example:
Code:
<document>
<element>
...Stuff...
</element>
<element>
...Stuff..
</element>
</document>
Right now I am trying this regex:
Code:
<element([^>]*)>(.*)</element>
which gives me basically:
Code:
<element>
...Stuff...
</element>
<element>
...Stuff..
</element>
I'm trying to make it just return the first element like:
Code:
<element>
...Stuff...
</element>
For some reason I can't seem to write the regex right to have it stop when it reaches the first </element>
Any suggestions?
__________________
- Zoram
Please login or register to view this content. Registration is FREE - Web Application Development
|