Home > Back-end >  Regex Issue - Cannot get the correct value after title="
Regex Issue - Cannot get the correct value after title="

Time:07-15

I am having issues with regex and I don't know how to proceed. I need to get the value "ITOM Control Board Major Alarm 4 Set" and I am not able to do so since I have two different set of line code.

Regex Website: http://regexstorm.net/tester My current tester results

Pattern: (?<=title=")(.*)

Values:

<td  title="" ng-non-bindable="" data-original-title="ITOM Control Board Major Alarm 4 Set 
Message: User

<td  title="ITOM Control Board Major Alarm 4 Set 
Message: User

Here is the image for what is happening at the moment

CodePudding user response:

(?<=title=")ITOM Control Board Major Alarm 4 Set - This might help.

Demolink

CodePudding user response:

If the text to search is exactly as stated then this might help:

title="([^\n"] )

This will match anything after title=" that is not a quote (") or a new line (\n)

See the example: https://regex101.com/r/GVEKjF/1

If the text to search has the title surrounded by both quotes, then try:

title="([^"] )

Hope this helps

  • Related