Trying to develop a regular expression to extract sentences that don't contain specific words. To keep it simple, IHere is a simple example:
Input: Sagittal scout images cervicothoracic : Mild-to-moderate multilevel spondylosis. Fracture present.
Desired Output: Fracture present.
Attempt #1
Regex:
[^.]*(?!cervi(c|x))[^.]*\.
Actual Output: Sagittal scout images cervicothoracic : Mild-to-moderate multilevel spondylosis. Fracture present.
Attempt #2:
Regex:
[^.]*[^(cervi(c|x))][^.]*\.
Actual Output: Sagittal scout images cervicothoracic : Mild-to-moderate multilevel spondylosis. Fracture present.
Can verify these results in https://regexr.com/