Let’s say, need a character string like this “64d3ab4de4bae1091e5de441” wiht only digitnumbers, lowercase and Upper case letters from a to f, and A to F respectively and 24 characters.

Regex offers a way to match this type of strings.

In this case, the regex expression would be as follows:

/^[0-9a-fA-F]{24}$/

/^ this is the start

$/ this is the end

[0-9a-fA-F] this indicates that it should be digitnumbers from 0 to 9, and string characters from a to f, and A to F, respectively.

{24} this, in curly brackets, the number of characters

that is all