--- a/mbed_lstools/lstools_base.py
+++ b/mbed_lstools/lstools_base.py
@@ -672,13 +672,13 @@
         @return Target id or None
         """
         # Detecting modern mbed.htm file format
-        m = re.search('\?code=([a-fA-F0-9]+)', line)
+        m = re.search(r'\?code=([a-fA-F0-9]+)', line)
         if m:
             result = m.groups()[0]
             logger.debug("Found target id %s in htm line %s", result, line)
             return result
         # Last resort, we can try to see if old mbed.htm format is there
-        m = re.search('\?auth=([a-fA-F0-9]+)', line)
+        m = re.search(r'\?auth=([a-fA-F0-9]+)', line)
         if m:
             result = m.groups()[0]
             logger.debug("Found target id %s in htm line %s", result, line)
