tkrunning
(Thomas K. Running)
5 oktober 2020 om 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 likes
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 december 2020 om 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 likes
david
(David Taylor)
7 december 2020 om 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 likes
david
(David Taylor)
9 december 2020 om 08:26
5
That’s merged - watched words can now be up to 100 chars long.
4 likes
Thank you very much for that change! Have nice holidays and christmas!
1 like
david
(David Taylor)
gesloten
9 december 2020 om 18:00
7
This topic was automatically closed after 9 hours. New replies are no longer allowed.