Re: help with sed-friendly regex with negative look-ahead syntax for sendmail

"[email protected] [sed-users]" <[email protected]> 02 Mar 2017 15:39:31 +0000
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
Hi Sharma, 

 But I don't have to break it up piece by piece as this works by itself:
 

 [a-zA-Z_0-9.-]+<@[a-zA-Z_0-9-]+?\.+[a-zA-Z_0-9.-]+?\.(us|info|to|br|bid|cn|ru)
 

 It's the negative lookahead that I can't figure out. This tutorial says POSIX should work and perhaps I have to use one of the switches like -s or -n: http://etutorials.org/Server+Administration/Sendmail/Part+III+The+Configuration+File/Chapter+23.+The+K+Database-Map+Configuration+Command/regex/ http://etutorials.org/Server+Administration/Sendmail/Part+III+The+Configuration+File/Chapter+23.+The+K+Database-Map+Configuration+Command/regex/
 

 But this might fall out of the scope of this group as it really may be a sendmail question.
 

---In [email protected], <sharma__r@...> wrote :

 That is because you are using the GNU sed's enhanced syntax us\|info\|.... 
 which "sendmail" will not like. 
 
 
 You'll have to break it up piece by piece, like as, 
 
 
 /[a-zA-Z_0-9.-]\{1,\}<@[a-zA-Z_0-9-]\..\{1,\}[a-zA-Z_0-9.-]\.us/bOK 
 /[a-zA-Z_0-9.-]\{1,\}<@[a-zA-Z_0-9-]\..\{1,\}[a-zA-Z_0-9.-]\.info/bOK 
 .... 
 
 
 d 
 :OK 
 # do whatever you wanted to do with the .us|.info|.... mails here 
 
 
 ---In [email protected] mailto:[email protected], <rkudyba@...> wrote : 
 
 Hm no matter what I try sendmail replies with: " 
 /etc/mail/sendmail.cf: line 200: unknown configuration line "/[a-zA-Z_0-9.-]\{1,\}<@[a-zA-Z_0-9-]\..\{1,\}[a-zA-Z_0-9.-]\.(us\|info\|to\|br\|bid\|cn\|ru\)/{" 
 Perhaps it's not exactly sed syntax for sendmail? 
 
 
 [Non-text portions of this message have been removed] 
 
 
 
 
 [Non-text portions of this message have been removed]


 
  



[Non-text portions of this message have been removed]