Back

Need some Help with Regex

  • 0
  • Web
error β™‘
2 Oct, 2023, 10:13

This is in regards to https://github.com/appwrite/console/pull/553 @Steven Basically there are 2 problems:

  1. Unit tests are validating Incorrectly (Investiging it)
  2. A regex pattern to match the cron expression is incresingly complex, Instead i have broken it down and tested the regex of indiviidual parts of the cron, while combing it however there are edges cases that are popping up

Paths I can Take:

  1. I can continue on trying to debug this regex expression (need some help)
  2. A different route would be, us relying on this function instead of a single regex expresssion for client side validation, as far as my tests went this function is working correctly (not sure if this is a good idea, but it would work well)
TL;DR
The user is asking for help with a complex regex pattern used for validation. They are facing two problems: incorrect unit test validation and issues with combining individual parts of the regex pattern. They suggest either continuing to debug the regex expression or using a different function for client-side validation.
Drake
3 Oct, 2023, 18:12

can we simplify the cron syntax? covering the usual expressions should be good enough

Drake
3 Oct, 2023, 18:12

as for testing...i would want to make sure we're testing with the input because it seems like it may not accept all regex patterns

error β™‘
7 Oct, 2023, 06:28

i was trying to cover all the test cases to be accepted, they are extensive. i can simplify it to cover a subset of the tests

error β™‘
7 Oct, 2023, 06:35

like i said, we could switch to manual validation if that is okay

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more