.net - Regex ? in lookbehind not consuming -
lookbehind ? not consuming :
regex:
(?i)(?<=\bsubject:?).+$
text:
subject: asdf adsf
match
: asdf adsf
i don't want : included in match
if search on:
subject asdf adsf
matches:
asdf adsf
behavior want
appears treat : optional not consuming
if match on subject:? greedy , includes :
use regex (?i)(?<=\bsubject:?)[^:].*$
Comments
Post a Comment