Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils.misc.cleanupText(): replace local function #1043

Open
prjemian opened this issue Nov 20, 2024 · 1 comment
Open

utils.misc.cleanupText(): replace local function #1043

prjemian opened this issue Nov 20, 2024 · 1 comment
Labels
task Something to be done.
Milestone

Comments

@prjemian
Copy link
Contributor

I think you could replace this local function and accompanying join() with:

    pattern = "[^a-zA-Z0-9_]"
    return re.sub(pattern, replace, text)

It matches characters not in the set (^) and substitutes them with replace. Not really in the scope of this PR, though.

Originally posted by @canismarko in #1042 (comment)

@prjemian
Copy link
Contributor Author

@canismarko Thanks for the suggestion!

@prjemian prjemian added this to the 1.7.2 milestone Nov 20, 2024
@prjemian prjemian added the task Something to be done. label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Something to be done.
Projects
None yet
Development

No branches or pull requests

1 participant