Page MenuHomeDevCentral

Declare regular expression patterns as raw Python strings
ClosedPublic

Authored by dereckson on Jul 4 2026, 12:09.
Tags
None
Referenced Files
F54307881: D4112.diff
Sat, Oct 17, 04:37
F54282660: D4112.diff
Fri, Oct 16, 23:23
Unknown Object (File)
Fri, Oct 16, 18:02
Unknown Object (File)
Thu, Oct 15, 02:17
Unknown Object (File)
Sat, Oct 10, 18:55
Unknown Object (File)
Sat, Oct 10, 09:18
Unknown Object (File)
Sat, Oct 10, 04:33
Unknown Object (File)
Sat, Oct 10, 03:43
Subscribers
None

Details

Summary

This follow current Python style best practice when no escape
is needed, and avoid a syntax warning when the string escapes
a character only to be escaped for regexp, not for Python strings.

Fixes the following issue on Python 3.12+:

/usr/local/bin/shell:138: SyntaxWarning: invalid escape sequence '\|'
  matches = re.search("(.*)\|(.*)", variable)

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Passed
Unit
No Test Coverage
Branch
main
Build Status
Buildable 6723
Build 7011: arc lint + arc unit

Event Timeline

dereckson created this revision.
dereckson edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jul 4 2026, 12:14