Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discord tag regular expression validation Google Forms

Is there any way you can use a regular expression in Google Forms to check if their input matches a pattern for a Discord tag? I already tried this: #[0-9]{4}$, but that's only valid for input that starts with a '#' followed by 4 numeric digits. I know this regex (next line) works for Discord tags, maybe there is a way to convert that to a regular expression in Google Forms?

/^((.+?)#\d{4})/

A Discord tag is constructed by their username followed by an '#' and then finished with 4 numbers. A few examples are:

  • Anna#1234
  • Bob#5601
  • Ryan Peterson#5640

Thanks in advance!

like image 332
DataMind Avatar asked May 06 '26 22:05

DataMind


1 Answers

EDIT (following OP's revised question)

You can also use the following

.+#\d{4}

As mentioned on The Discord Wiki

A "Discord tag" is the combination of a username and their discriminator (a 4-digit number). The tag always appears as username#discriminator.

Not all regular expressions are supported in Google Forms validation.
In this case the regular expression (regex) you should use is

.+\d{4}$

enter image description here

like image 168
marikamitsos Avatar answered May 08 '26 15:05

marikamitsos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!