NordicSemiconductor / nRF-Sniffer-for-802.15.4

nRF-based 802.15.4 sniffer (firmware and software)
Other
221 stars 64 forks source link

`SyntaxWarning: invalid escape sequence '\s'` when compiling RCV_REGEX #60

Open Xelynega opened 4 months ago

Xelynega commented 4 months ago

The following error is given when running the nrf802154_sniffer.py script in Python 3.12.2:

nrf802154_sniffer.py:81: SyntaxWarning: invalid escape sequence '\s'
  RCV_REGEX = 'received:\s+([0-9a-fA-F]+)\s+power:\s+(-?\d+)\s+lqi:\s+(\d+)\s+time:\s+(-?\d+)'

I was able to fix it by escaping all the backslashes, but not sure what the correct fix would be here to maintain version compatibility with the version it was working in previously.

stig-bjorlykke commented 4 months ago

What about changing this line to RCV_REGEX = r'received:\s+([0-9a-fA-F]+)\s+power:\s+(-?\d+)\s+lqi:\s+(\d+)\s+time:\s+(-?\d+)'