Workflowengine "The given regular expression is invalid"
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
Steps to reproduce
- Create a new flow (concrete workflow app doesn't matter)
- Choose
File MIME type - Choose
matches(ordoes not match) - Choose
PDF documents(orFolder)

Note: the filters for
ImagesandOffice Documentsare working.
Expected behaviour
Workflow can be created
Actual behaviour
If i try to save the workflow an error message is raised "The given regular expression is invalid"
Server configuration
Operating system: Ubuntu 20.04
Web server: Apache2
Database: MySql 8.0
PHP version: 7.4
Nextcloud version: 20.0.1
Additional information
- I think this only applies to Nextcloud 20 or later (because like i saw the filter "matches" is not available in NC 19)
- The error message comes from https://github.com/nextcloud/server/blob/2a154f57ceeae89b15dfe166aff3a7916afde94c/apps/workflowengine/lib/Check/AbstractStringCheck.php#L91
- The defined regex patterns at https://github.com/nextcloud/server/blob/2a154f57ceeae89b15dfe166aff3a7916afde94c/apps/workflowengine/src/components/Checks/FileMimeType.vue#L72 and https://github.com/nextcloud/server/blob/2a154f57ceeae89b15dfe166aff3a7916afde94c/apps/workflowengine/src/components/Checks/FileMimeType.vue#L87 does not seem to be corret. These are passed to the serverside function mentioned above.
Currently there is also an open issue at https://github.com/R0Wi/workflow_ocr/issues/32 where multiple users reported this problem.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the regex definitions in apps/workflowengine/src/components/Checks/FileMimeType.vue, then inspect validation in apps/workflowengine/lib/Check/AbstractStringCheck.php around line 91. Reproduce the File MIME type matches and does-not-match cases for PDF documents and Folder. Done means these filters use valid patterns and the workflow can be saved without the invalid-regex error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- full-stack
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100