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

returns the string instead of groups for re_search function if there is no any group specified #30

Open
peonone opened this issue Nov 26, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@peonone
Copy link
Member

peonone commented Nov 26, 2019

It's a very common use case that extracts the number from a string, like 4.3 from 4.3 out of 5 stars.

For example, for this input ["4.3 aa", "2.6 bb"], we want to extract a result as ["4.3", "2.6"] but we don't have a quick way to do it.

re_search("([0-9.]+)")|first does not work, as first takes the first row of the output, not a list of the first group, so we will get ('4.3',)

My proposal is to return a string instead of the groups, if no any group specified, then we will get the expected result by re_search("[0-9.]+")

@akshayphilar akshayphilar added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Dec 2, 2019
@Gallaecio
Copy link
Member

It may be worth allowing commas as well, both because they are decimal separators in some languages and because they are thousand separators in other languages, including English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants