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

Regular expression function #84

Open
asirota opened this issue Jul 20, 2022 · 3 comments
Open

Regular expression function #84

asirota opened this issue Jul 20, 2022 · 3 comments
Assignees

Comments

@asirota
Copy link
Member

asirota commented Jul 20, 2022

Is 2.0 of WATM supporting regex expressions in default or alternative text in 2.0?

If we are supporting RegEx's we need to have a toggle to turn that off because people can search for things like [ and ( and forget to escape these characters causing all sorts of trouble.

If we don't support Regular Expression, we should add support and add a toggle to turn it on or off, with Regex=off being the default.

@asirota asirota added this to the 2.0 milestone Jul 20, 2022
@mDisna
Copy link
Contributor

mDisna commented Jul 20, 2022

2.0 does not support regex - this can be added as a new function, separate from the normal replace function.

What would be a use-case for this however?

@asirota
Copy link
Member Author

asirota commented Jul 22, 2022

oh that's actually good -- the use case would be remote and only for very technical people that wanted to find and replace patterns of text not actual specific words... Let's leave it off for now.

@asirota asirota closed this as completed Jul 22, 2022
@asirota asirota reopened this Nov 28, 2023
@asirota asirota modified the milestones: 2.0, 2.1.3 Nov 28, 2023
@asirota
Copy link
Member Author

asirota commented Nov 28, 2023

Here's one use case for the regex function - replacing the : for an h in time patterns

12:00 -> 12h00
19:59 -> 19h59

The default text would be the regular expression pattern to search, and the replacement text would have the regex pattern to use for replacement of the : character

default text: matches 24 hour HH:MM format

([0-9]|0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])

this could be the replacement text
$1h$2

where $1 and $2 are the matching groups from the default text

@asirota asirota changed the title Regular expression support in 2.0? Regular expression function Nov 28, 2023
@asirota asirota modified the milestones: 2.1.3, 2.2 Apr 26, 2024
@asirota asirota removed this from the 2.2 milestone Aug 9, 2024
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

No branches or pull requests

2 participants