I have below the possible lines and I need to match specific characters.
Possible string to match:
dsg.1.2.3.4.5.6.7.5 = STRING: 1234 blah blah blah
OR
dsg.1.2.3.4.5.6.7.5 = STRING: "1234 blah blah blah"
Below is the regex I tried. It works, but for the first line, it matches "
\=\s*STRING\:\s(?=\")\"([^"]*)|([^:]*$)
To match the line above, I used a condition that is well suited for dsg.1.2.3.4.5.6.7.5 = STRING: "1234 blah blah blah"
Not dsg.1.2.3.4.5.6.7.5 = STRING: 1234 blah blah blah
Exit after the match:
2. [29-58] ` 1234 blah blah blah`
Is required:
1. [29-58] `1234 blah blah blah` --> No space
Please help me in this matter.
source
share