Skip to content

Commit

Permalink
Remove redundant backslashes from regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
amendlik committed Jan 3, 2025
1 parent d08d521 commit 097db55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions salt/modules/pkgng.py
Original file line number Diff line number Diff line change
Expand Up @@ -2369,15 +2369,15 @@ def _parse_upgrade(stdout):
"""
# Match strings like 'python36: 3.6.3 -> 3.6.4 [FreeBSD]'
upgrade_regex = re.compile(
r"^\s+([^:]+):\s([0-9a-z_,.]+)\s+->\s+([0-9a-z_,.]+)\s*(\[([^]]+)\])?\s*(\(([^)]+)\))?"
r"^\s+([^:]+):\s([0-9a-z_,.]+)\s+->\s+([0-9a-z_,.]+)\s*(\[([^]]+)])?\s*(\(([^)]+)\))?"
)
# Match strings like 'rubygem-bcrypt_pbkdf: 1.0.0 [FreeBSD]'
install_regex = re.compile(
r"^\s+([^:]+):\s+([0-9a-z_,.]+)\s*(\[([^]]+)\])?\s*(\(([^)]+)\))?"
r"^\s+([^:]+):\s+([0-9a-z_,.]+)\s*(\[([^]]+)])?\s*(\(([^)]+)\))?"
)
# Match strings like 'py27-yaml-3.11_2 [FreeBSD] (direct dependency changed: py27-setuptools)'
reinstall_regex = re.compile(
r"^\s+(\S+)-(?<=-)([0-9a-z_,.]+)\s*(\[([^]]+)\])?\s*(\(([^)]+)\))?"
r"^\s+(\S+)-(?<=-)([0-9a-z_,.]+)\s*(\[([^]]+)])?\s*(\(([^)]+)\))?"
)

result = {
Expand Down

0 comments on commit 097db55

Please sign in to comment.