Need help with regular expression

Hi,

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

<label for="agent_ef26d602d79d453fab5rgf6ae3c1b301_LangPref_0">&nbsp;English</label>

What am I doing wrong in the following:

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

Please help!
Peach

You mean, you want to ignore just “ef26d602d79d453fab5rgf6ae3c1b301_LangPref_0” this part.

Yes because that is a random number that I dont really care.

You can simply do a regular expression everything between the double quotes and do a replace.to put the “agent_” part back in place.

sorry I am still new to this. Do I do this? I am not sure how I can replace.

<label[^>]*for=“agent_[*0-9a-zA-Z]”>

You need to show your project so we know what the context is.
If you are talking about straight string. Here is the replace( )
https://www.w3schools.com/jsref/jsref_replace.asp

If you are talking about a <label> element. You need to use DOM to get to that agent string.