tkrunning
(Thomas K. Running)
5. Oktober 2020 um 08:07
1
Hi guys,
I am trying to send posts containing (international) phone numbers to the approval queue, and am trying to add the following regex as a watched word:
^(\+|00)((?:9[679]|8[035789]|6[789]|5[90]|42|3[578]|2[1-689])|9[0-58]|8[1246]|6[0-6]|5[1-8]|4[013-9]|3[0-469]|2[70]|7|1)(?:\W*\d){0,13}\d$
However, it is over the current limit of 50 characters for watched words. I believe this limit made sense before regex was added as an option for watched words, but is there still a good reason for keeping this limit in place?
Or is there a way of overriding it?
2 „Gefällt mir“
devnull
2. Dezember 2020 um 21:19
2
I’m also need more than 50 chars for my RegEx for identifying IBAN:
\b[A-Z]{2}[0-9]{2}(?:[ ]?[0-9]{4}){4}(?!(?:[ ]?[0-9]){3})(?:[ ]?[0-9]{1,2})?\b
When do you think you will answer that request?
sam
(Sam Saffron)
6. Dezember 2020 um 23:29
3
There is no way of overriding this, I guess we are almost at the rule of 3 here about adding a longer limit.
@david are there any concerns around doubling the size?
2 „Gefällt mir“
david
(David Taylor)
7. Dezember 2020 um 00:04
4
All watched words are combined to form a single regex, so we do need to be a little careful. But doubling to 100 is probably fine - no worse than two, 50 character “words”.
Here’s a PR for the change
https://github.com/discourse/discourse/pull/11437
8 „Gefällt mir“
david
(David Taylor)
9. Dezember 2020 um 08:26
5
That’s merged - watched words can now be up to 100 chars long.
4 „Gefällt mir“
devnull
9. Dezember 2020 um 08:50
6
Thank you very much for that change! Have nice holidays and christmas!
1 „Gefällt mir“
david
(David Taylor)
Geschlossen,
9. Dezember 2020 um 18:00
7
This topic was automatically closed after 9 hours. New replies are no longer allowed.