Perl regex to match only if not followed by both patterns -
i trying write pattern match match when string not followed both following patterns. right have pattern i've tried manipulate can't seem match correctly.
current pattern:
/(address|alias|parents|members|notes|host|name)(?!(\t{5}|\s+))/ i trying match when string not spaced correctly not if part of larger word.
for example want match,
host \t{4} but not,
hostgroup \t{5} in above example match hostgroup , end separating 2 separate words "host" , "group"
match:
notes \t{4} but not,
notes_url \t{5} using pattern ends turning into:
notes \t{5} _url hopefully makes bit more sense.
i'm not @ clear want, word boundaries ask.
does work you?
/\b(address|alias|parents|members|notes|host|name)\b(?!\t{5})/ update
having understood problem better, want?
/\b(address|alias|parents|members|notes|host|name)\b(?!\t{5}(?!\t))/
Comments
Post a Comment