Skip to content

Commit

Permalink
Merge pull request #1 from acconeer/fix_regexp
Browse files Browse the repository at this point in the history
Make regexp strings "raw-strings"
  • Loading branch information
freand76 authored Sep 20, 2024
2 parents d9bfb20 + 3a5b284 commit 034fcea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions usbtmc/usbtmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def parse_visa_resource_string(resource_string):
# USB::1234::5678::SERIAL::INSTR
# USB0::0x1234::0x5678::INSTR
# USB0::0x1234::0x5678::SERIAL::INSTR
m = re.match('^(?P<prefix>(?P<type>USB)\d*)(::(?P<arg1>[^\s:]+))'
'(::(?P<arg2>[^\s:]+(\[.+\])?))(::(?P<arg3>[^\s:]+))?'
'(::(?P<suffix>INSTR))$', resource_string, re.I)
m = re.match(r'^(?P<prefix>(?P<type>USB)\d*)(::(?P<arg1>[^\s:]+))'
r'(::(?P<arg2>[^\s:]+(\[.+\])?))(::(?P<arg3>[^\s:]+))?'
r'(::(?P<suffix>INSTR))$', resource_string, re.I)

if m is not None:
return dict(
Expand Down

0 comments on commit 034fcea

Please sign in to comment.