This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Tidy some regex in crashlog.py (NFC)
ClosedPublic

Authored by kastiglione on Aug 5 2022, 4:26 PM.
Tokens
"Yellow Medal" token, awarded by mib.

Details

Summary

A spiritual follow up to D131032. I noticed some regex could be simplified.

This does some of the following:

  1. Removes unused capture groups
  2. Uses non-capturing (?:...) groups where grouping is needed but capturing isn't
  3. Removes trailing .*
  4. Uses \d over [0-9]
  5. Uses raw strings
  6. Uses {N,} to indicate N-or-more

Also improves the call site of a re.findall.

Diff Detail

Event Timeline

kastiglione created this revision.Aug 5 2022, 4:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2022, 4:26 PM
kastiglione requested review of this revision.Aug 5 2022, 4:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2022, 4:26 PM

this includes changes in D131032 and so depends on it merging first.

This revision is now accepted and ready to land.Aug 6 2022, 9:15 AM
mib awarded a token.Aug 11 2022, 11:15 AM

Fix one crashlog test

This revision was landed with ongoing or failed builds.Aug 11 2022, 3:25 PM
This revision was automatically updated to reflect the committed changes.