enhance: Add regex replace helpers, and ansiregex#3782
enhance: Add regex replace helpers, and ansiregex#3782LaurenceJJones wants to merge 2 commits intocrowdsecurity:masterfrom
Conversation
…ng the right regexp for ansi color codes
|
@LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
@LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3782 +/- ##
==========================================
+ Coverage 60.63% 60.66% +0.03%
==========================================
Files 410 410
Lines 42614 42659 +45
==========================================
+ Hits 25838 25880 +42
- Misses 14640 14642 +2
- Partials 2136 2137 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🎯 Summary
Added regex replacement functions and ANSI escape sequence handling to the expression helpers library.
to help with crowdsecurity/hub#1430
The idea would be to use it as a transform in this case:
Functions**
ReplaceRegexp()- Replaces only the first occurrence of a regex patternReplaceAllRegex()- Replaces all occurrences of a regex patternAnsiRegex()- Returns regex pattern for ANSI escape sequencesANSI Escape Sequence Support
\x1b) and octal (\033) representationsBasic Regex Replacement
ANSI Code Stripping