regex - Regular expressions wildcard -
it's day 001 me on regular expressions sorry if bit stupid, i've done research can't find answer question; because i'm searching wrong thing.
i have huge .cvs file , want delete entries containing term:
subscribe newsletter: no
the entries not uniform - mean
-- here subscribe newsletter: no --
i've thinned .csv right down using regular expressions (i think? i'm using find , replace in sublime 3) delete elements can , i'm there. i'm looking way use wildcard ignore part don't know; this:
^.*-- **wild-card** subscribe newsletter: no.*\n
if can recommend can research how fabulous, said might off here it's literally day 1 if point me in right direction great!
1st issue: dot .
doesn't match newlines unless use dotall flag - need span multiple lines.
you need negative ahead (?!--)
assert dots don't match accross segment delimiters --
.
try this:
(?s)^--((?!--).)*?subscribe newsletter:\s+no((?!--).)*
you dont need trailing newline, since dot match dotall flag (?s)
enabled.
Comments
Post a Comment