I am trying to capture a string that can contain any character but must always be followed by ';' I want to capture it and trim the white space around it. I've tried using positive lookahead but that does not seem to exclude the whitespace. Example:
this is a match ;
this is not a match
regex:
.+(?=\s*;)
result:
"this is a match " gets captured with trailing white space behind.
expected result:
"this is a match" (without whitespace)