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

Does the input field accept regular expressions? #58

Closed
hj-beckers opened this issue Aug 31, 2020 · 8 comments
Closed

Does the input field accept regular expressions? #58

hj-beckers opened this issue Aug 31, 2020 · 8 comments

Comments

@hj-beckers
Copy link

version workflow external scripts 1.4.0, nextcloud server 19.0.2

in
'if file created and filename is " "', does the input field accept regular expressions? Only when I enter a static name eg. "testfile.txt" my script gets executed. Entering "test*.txt" oder "test.*.txt" doesn't match for "testfile.txt". Is a special syntax needed?

@blizzz
Copy link
Member

blizzz commented Aug 31, 2020

select "matches" instead of "is", then you can use regex expressions. This is provided by the worklfowengine, part of Nextcloud server.

@hj-beckers
Copy link
Author

The only selection possible is (in the german version) "ist/ist nicht" translated "is/is not" ? I can enter a value, would I use "entspricht"? Can I find the german values somewhere in the source?

@hj-beckers
Copy link
Author

found apps/workflowengine/l10n/de_DE.js: "entspricht/entspricht nicht". But why do these values not show up in the dropdown menu? I'm using chromium Version 84.0.4147.135 (openSUSE Build) (64-Bit).

@hj-beckers
Copy link
Author

hj-beckers commented Aug 31, 2020

Further tests: I can enter different values, but I cannot save the rule. The input field only accepts "ist/ist nicht". Switching to en_US makes no difference: only "is/is not" is available.

@blizzz
Copy link
Member

blizzz commented Sep 1, 2020

Ah, we have some hidden magic here. Perhaps should make it more obvious… anyway, the comparator changes to matches automatically, when you start your check with a slash ("/").

@hj-beckers
Copy link
Author

Entering a "/" at the beginning of the input field restricts the selection to "match/does not match" or the german "entspricht/entspricht nicht". But now the rule "if file created and file name matches /test.*.txt" switches the save button to "This configuration is invalid" (The given regular expression is invalid). Where can I find the allowed syntax?

@blizzz
Copy link
Member

blizzz commented Sep 1, 2020

@hj-beckers the pattern has to be encapsulated in slashes. If you remove the leading slash, it switches back to is/is not.

@hj-beckers
Copy link
Author

It works. Thank you for the prompt reaction, Closing the "bug".

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