Help with RegExp!

  • Thread starter Thread starter celerno
  • Start date Start date
C

celerno

i need a regexp to parse some like this


<AwordHere> any thing here #$% #@$#@ /./09812 anything </AwordHere>

this works for that:
<(?<field>\w+)>(?<value>.*)(?<field></\w+>)

but when i have
<AwordHere> any thing here #$% #@$#@ /./09812 anything </AwordHere>
<OtherWordHere> any thing here #$% #@$#@ /./09812 anything </OtherWord>


my value string gets

"any thing here #$% #@$#@ /./09812 anything </AwordHere>
<OtherWordHere> any thing here #$% #@$#@ /./09812 anything"

can any one help me?... thanks...
 
celerno said:
i need a regexp to parse some like this


<AwordHere> any thing here #$% #@$#@ /./09812 anything </AwordHere>

this works for that:
<(?<field>\w+)>(?<value>.*)(?<field></\w+>)

but when i have
<AwordHere> any thing here #$% #@$#@ /./09812 anything </AwordHere>
<OtherWordHere> any thing here #$% #@$#@ /./09812 anything </OtherWord>


my value string gets

"any thing here #$% #@$#@ /./09812 anything </AwordHere>
<OtherWordHere> any thing here #$% #@$#@ /./09812 anything"

can any one help me?... thanks...

Make the match non-gready. Put a question mark after ".*".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Pivot Table Problem 2
regexp question 1
Regexp help 3
RegExp 3
Regexp matching blocks of text 2
Tokenizing a large buffer 10
Does that RegExp makes sense to you, people? 5
JavaScript RegExp Quantifiers 2

Back
Top