From b561b086835bf84950fb085d1de4a07e9c0280af Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Mon, 8 Jul 2024 17:08:53 -0600 Subject: [PATCH] Use `r` strings when constructing regex patterns --- vxi11/vxi11.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vxi11/vxi11.py b/vxi11/vxi11.py index 231582d..c7f4221 100644 --- a/vxi11/vxi11.py +++ b/vxi11/vxi11.py @@ -131,8 +131,8 @@ def parse_visa_resource_string(resource_string): # TCPIP0::10.0.0.1::gpib,5::INSTR # TCPIP0::10.0.0.1::usb0::INSTR # TCPIP0::10.0.0.1::usb0[1234::5678::MYSERIAL::0]::INSTR - m = re.match('^(?P(?PTCPIP)\d*)(::(?P[^\s:]+))' - '(::(?P[^\s:]+(\[.+\])?))?(::(?PINSTR))$', + m = re.match(r'^(?P(?PTCPIP)\d*)(::(?P[^\s:]+))' + r'(::(?P[^\s:]+(\[.+\])?))?(::(?PINSTR))$', resource_string, re.I) if m is not None: