Skip to content

Does the input field accept regular expressions? #58

Closed

Description

@hj-beckers

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?

Activity

  1. blizzz commented on Aug 31, 2020

    @blizzz
    Member

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

  2. hj-beckers commented on Aug 31, 2020

    @hj-beckers
    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?

  3. hj-beckers commented on Aug 31, 2020

    @hj-beckers
    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).

  4. hj-beckers commented on Aug 31, 2020

    @hj-beckers
    Author

    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.

  5. blizzz commented on Sep 1, 2020

    @blizzz
    Member

    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 ("/").

  6. hj-beckers commented on Sep 1, 2020

    @hj-beckers
    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?

  7. blizzz commented on Sep 1, 2020

    @blizzz
    Member

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

  8. hj-beckers commented on Sep 1, 2020

    @hj-beckers
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions