I have a text file that denotes remarks with a single \'
.
Some lines have two quotes but I need to get everything from the first instance of a \
https://regex101.com/r/Jjc2xR/1
/(\w*\(Hex\): w*)(.*?)(?= |$)/gm
I'm sure this one works, it will capture de hexa serial in the badly structured text multilined bellow
Space Reservation: disabled
Serial Number: wCVt1]IlvQWv
Serial Number (Hex): 77435674315d496c76515776
Comment: new comment
I'm a eternal newbie in regex but I'll try explain this one
(\w*(Hex): w*) : Find text in line where string contains "Hex: "
(.*?) This is the second captured text and means everything after
(?= |$) create a limit that is the space between = and the |
So with the second group, you will have the value