Skip to content
New issue

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

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

Already on GitHub? # to your account

“regular expression” in “Create class” does not support full RE syntax #6962

Open
kaimikael opened this issue Dec 20, 2024 · 0 comments
Labels
bug report Bug is reported by user, not yet confirmed by the core team

Comments

@kaimikael
Copy link

What's wrong?

The documentation for “Create class” says: “Substring: regex-defined substring that will match the values from the above-defined attribute”
I took this to mean that you can define an arbitrary regular expression in the Substring field, but as can be seen in the attached screenshot, when I entered .*—which should match any string—I got no matches at all. I have played around with the input and it seems that what you enter is actually treated as a literal substring to be matched. If this is the intended behaviour, then please treat this as a feature request:
I’d like the Substring field to support the full Python regular expression syntax, including \number, so that matched substrings can be used in the Name section. In my concrete case I want to enter the Substring (.*) \([12]\) and use \1 in the Name field, so that the item Belgium (2) is renamed Belgium.

Failing that, “regex-defined” should be deleted from the documentation text.

How can we reproduce the problem?

Input any data. Connect to a “Create Class” widget. Select any string feature. Enter .* as Substring. Note that no strings are matched.

What's your environment?

Screenshot 2024-12-20 at 11 45 44
@kaimikael kaimikael added the bug report Bug is reported by user, not yet confirmed by the core team label Dec 20, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug report Bug is reported by user, not yet confirmed by the core team
Projects
None yet
Development

No branches or pull requests

1 participant