Re: Regexp issue in NAPTR rewrite

2009-05-13 Thread sandoche BALAKRICHENAN

Mark Andrews wrote:

In message 4a093b9c.5060...@afnic.fr, sandoche BALAKRICHENAN writes:
  
I want to rewrite a query of the form 
sgtin.5.4.0.0.0.1.3.2.4.5.6.7.6.id.onsam.test to 
sgtin.5.4.0.0.0.1.3.2.4.5.6.7.6.id.onseu.test using NAPTR rewrite.


The NAPTR RR in the zone config is as follows:

sgtin.5.4.0.0.0.1.3.2.4.5.6.7.6.id.onsam.testIN NAPTR
00r  !^sgtin\.([0-9])$!\1.id.onseu.test!.


BIND does not  accept backref \1 . It shows a syntax error.

Is the above regexp correct?



You failed to properly escape the string.

From RFC2168.

   Recall that the regular expression used \2 to extract a domain name
   from the CID, and \. for matching the literal '.' characters
   seperating the domain name components. Since '\' is the escape
   character, literal occurances of a backslash must be escaped by
   another backslash. For the case of the cid.urn.net record above, the
   regular expression entered into the zone file should be
   /urn:cid:.+@([^\\.]+\\.)(.*)$/\\2/i.  When the client code actually
   receives the record, the pattern will have been converted to
   /urn:cid:.+@([^.]+\.)(.*)$/\2/i.
  


Thanks. With double \\ it works.

begin:vcard
fn:Sandoche BALAKRICHENAN
n:;Sandoche BALAKRICHENAN
org:AFNIC
email;internet:sandoche.balakriche...@afnic.fr
title:Ingenieur RD
note;quoted-printable:Move Together=0D=0A=
	
x-mozilla-html:FALSE
version:2.1
end:vcard

___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Regexp issue in NAPTR rewrite

2009-05-12 Thread sandoche BALAKRICHENAN


I want to rewrite a query of the form 
sgtin.5.4.0.0.0.1.3.2.4.5.6.7.6.id.onsam.test to 
sgtin.5.4.0.0.0.1.3.2.4.5.6.7.6.id.onseu.test using NAPTR rewrite.


The NAPTR RR in the zone config is as follows:

sgtin.5.4.0.0.0.1.3.2.4.5.6.7.6.id.onsam.testIN NAPTR
00r  !^sgtin\.([0-9])$!\1.id.onseu.test!.


BIND does not  accept backref \1 . It shows a syntax error.

Is the above regexp correct?






begin:vcard
fn:Sandoche BALAKRICHENAN
n:;Sandoche BALAKRICHENAN
org:AFNIC
email;internet:sandoche.balakriche...@afnic.fr
title:Ingenieur RD
note;quoted-printable:Move Together=0D=0A=
	
x-mozilla-html:FALSE
version:2.1
end:vcard

___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users