Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add regex support for text filtering and replacement#191

Merged
aahnik merged 7 commits intomainfrom
add-regex-support
Jun 4, 2021
Merged

Add regex support for text filtering and replacement#191
aahnik merged 7 commits intomainfrom
add-regex-support

Conversation

@aahnik
Copy link
Owner

@aahnik aahnik commented Jun 3, 2021

@aahnik aahnik changed the title Add regex option for filter and replace Add regex support for text filtering and replacement Jun 3, 2021
@aahnik aahnik marked this pull request as draft June 3, 2021 11:36
@aahnik aahnik force-pushed the add-regex-support branch from 383ecbb to 2ba2e91 Compare June 3, 2021 18:46
@aahnik aahnik marked this pull request as ready for review June 3, 2021 18:47
Copy link
Owner Author

@aahnik aahnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@aahnik aahnik merged commit 360963f into main Jun 4, 2021
@aahnik aahnik deleted the add-regex-support branch June 6, 2021 04:44
@mujahidazamcsm
Copy link

mujahidazamcsm commented Aug 20, 2021

Hi @aahnik
The regex doesnt seem to be working.. below is my config. Can u plz let me know if something is missing or incorrect?

In the below list where basic text is present it works both in filtering as well as replacing, but the regex expressions dont work.. nothing happens.. and the text comes as is.. also the replace and filtering are case sensitive.. anyway to change it?


plugins:
filter:
text:
case_sensitive: false
regex: true
blacklist:
- "\s+(#\w+)\s*"
- "\s+(@\w+)\s*"
- "[Mm]\s*[Aa]\s*[Nn]\s*"
- "#tag"
- "\(?i)search"
- "quickly"
- "fast"
replace:
text:
"hello": C1
"test": C1
"quickly": c
"helo": h
"[Mm]\s*[Aa]\s*[Nn]\s*": "heello"
regex: true


Below is repeat again of what works and what doesnt.


Doesnt work -
- "\s+(#\w+)\s*"
- "\s+(@\w+)\s*"
- "[Mm]\s*[Aa]\s*[Nn]\s*"
- "\(?i)search"

Works but case sensitive
- "#tag"
- "quickly"
- "fast"

Doesnt work -

  "[Mm]\\s*[Aa]\\s*[Nn]\\s*": "heello"

Works but case sensitive
"hello": C1
"test": C1
"quickly": c
"helo": h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add regex support

2 participants