This is a discussion on NAPTR regex escape issues within the Bind Users forums, part of the DNS and Related Forums category; Hello, I am having trouble getting BIND to return regular expressions with escaped (meta) characters properly. I have an amount ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello, I am having trouble getting BIND to return regular expressions with escaped (meta) characters properly. I have an amount of NAPTR records which contain escaped backslashes (\\) and escaped metachars (i.e. \+). My problem lies in the fact that double backslashes in a zone file are returned as such - double backslashes. Single backslashes in the file are either dropped (i.e. in front of a +) or cause errors when in front of digits (for regex backreferences such as \1). For instance i have the following records in my enum.test zone file: 8.7.6.5.4.3.2.1.2.3 IN NAPTR 100 10 "U" "E2U+sip" "!^.*$!sip:\\1@shire.me!" 8.7.6.5.4.3.2.1.2.3 IN NAPTR 100 20 "U" "E2U+sip" "!^\\+(32)(12\\d\\d)(56\\d\\d)$!sip:\\1@\\2-\\3!" . When queried this returns: # host -t NAPTR 8.7.6.5.4.3.2.1.2.3.enum.test 8.7.6.5.4.3.2.1.2.3.enum.test NAPTR 100 20 "U" "E2U+sip" "!^.*$!sip:\\1@shire.me!" . --> \\1 instead of \1 ? 8.7.6.5.4.3.2.1.2.3.enum.test NAPTR 100 50 "U" "E2U+sip" "!^\\+(32)(12\\d\\d)(56\\d\\d)$!sip:\\1@\\2-\\3!" . --> \\+ instead of \+ ? \\d instead of \d ? What is the intended behaviour for regular expression escape sequences in NAPTR records in zone files? Should clients be built to handle the double backslashes that are returned? Preferably BIND would immedeately be able to return the correct regex. Thanks, Ben -- Ben Turner (Consultant) SIEMENS - IC MN D SU tel: +32 14 252326 |