Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to ignore all the text after agent_ for the following text:

<label for="agent_ef26d602d79d453fab5rgf6ae3c1b301_LangPref_0"> English</label>


What am I doing wrong in the following:

<label[^>]*for="agent_[^>]*">


Please help!

What I have tried:

I am still new to this so I read through some tutorials and came up with this. But it did not work.
<label[^>]*for="agent_[^>]*">
Posted
Updated 19-Sep-19 12:28pm
v3

1 solution

Try:
(?<=agent_).*?(?=_)

If you are going to play with regexes, then get a copy of Expresso[^] - it's free, and it examines and generates Regular expressions.
 
Share this answer
 
Comments
strawberry5 23-Sep-19 14:19pm    
Hi @OriginalGriff, it solved the issue. I also downloaded Expresso and played around with it. Thank you so much for all the help!
OriginalGriff 23-Sep-19 14:21pm    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900