Regex - How do I check for digits 01 to 52 in filenames?

3 hours ago 2
ARTICLE AD BOX

I receive filenames from a client that are structured according to the following scheme:

ghf50001BE_v02.pdf

ghf (3) then the calendar week (2) then the page number (3) then the issue (2) and finally, after the underscore, the version (3)

The calender week is (was) my Problem. The client send 53 for calender week and my output system run in trouble.

How can I ensure that the two digits are not larger than 53?

This is the actual regex:
(ghf)\\d{4}\[\\w\_\]+\[\\w\_\]+\[.\]pdf

I tried this, but it does not work:
(ghf)(0\[1-9\])|(1\[0-9\])|(2\[0-9\])|(3\[0-9\])|(4\[0-9\])|(5\[0-2\]){2}\[0-9\]{3}\[a-zA-Z\]{2}\[\_\]{1}\[a-zA-Z\]{1}\[0-9\]{2}\[.\]pdf

I must use regexe because the outputsystem only accept regex in the GUI

With CalendarWeekToDate(F1[3:5],0) (Its into the GUI) i set the calender week into a date and alwas on monday of the week. So for (KW)52 its 29.12.2025.

Read Entire Article