I'm trying to generate a regular expression to detect any string that :
Example : [Maxsens8 Innovations]
I'm using : https://regex101.com
I create this regular expression : ^\[[a-zA-Z0-9\]]$
This regular expression does not match to expressions that i'm looking for and i thing the problem
is about the last character .
I will be gratefull if someone explain to me how to generate the right regular expression that
detect strings like : [Maxsens Innovations] [Verifik8] [Divoluci] ...
Try:
^\[[a-zA-Z0-9 ]*\]$
or
^\[[a-zA-Z0-9\s]*\]$
\]$
Match ]
followed by end of line ($
)[
and ]
are meta-characters hence should be escaped.\s
to match any white-space char (including newline
) or single space
.Note: This shall match against single input line. If you have multiple fragments per line then skip the line start and end markers viz., ^
and $
.