-
Notifications
You must be signed in to change notification settings - Fork 77
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
plugin-flow-builder: resolve regex in keywords #2797
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vanbasten17
approved these changes
Mar 18, 2024
Iru89
changed the title
feat(plugin-flow-builder): resolve regexp in keywords
plugin-flow-builder: resolve regexp in keywords
Mar 18, 2024
AinaVendrell
approved these changes
Mar 18, 2024
Iru89
changed the title
plugin-flow-builder: resolve regexp in keywords
plugin-flow-builder: resolve regex in keywords
Mar 18, 2024
AlbertGom
approved these changes
Mar 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Iru89
force-pushed
the
feature/blt-624-task-keywords-as-regexp
branch
from
March 19, 2024 16:56
b87d901
to
e57e078
Compare
Iru89
force-pushed
the
feature/blt-611-task-add-custom-conditional-on-flow-builder-plugin
branch
from
March 20, 2024 14:37
19a7e4d
to
a1f9188
Compare
Base automatically changed from
feature/blt-611-task-add-custom-conditional-on-flow-builder-plugin
to
master-lts
March 20, 2024 14:38
Iru89
force-pushed
the
feature/blt-624-task-keywords-as-regexp
branch
from
March 20, 2024 14:45
e57e078
to
78d71f3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Being able to define keywords as regular expressions in the flow builder frontend, using the RegExp /pattern/flags format.
If the plugin detects that the keyword is a regular expression it will apply this in the user input, otherwise it will do the logic that was done until now to check if the exact word is in the user input.
Context
The keyword node until now could only pass words and what it checked was if the user input contained that word exactly as it was written, including upper and lower case.
With this new feature we can use regex to do pattern matching.
Approach taken / Explain the design
First it checks if the keyword is a regex if so it applies the regex on the user input. Otherwise it will do the logic that was done until now looking if the user input contains this word written as in the keyword node.
To document / Usage example
By using regex on a keyword you can capture inputs such as:
In the following image we can see a keyword node where there are two keywords the first one is the text country, if we only have this keyword it would only enter in the next node if the user input contains the word country in lowercase.
The second keyword is declared as a regex with the flag i which indicates that it will search case-insensitive.