My title can look like
(10) - lorem ipsum
(101) - lorem ipsum
(1) - lorem ipsum
lorem ipsum
I want to check if my title contains (number)
at the start
string.match(/^(+[0-9]+)+$/);
I'm not good on regex, can someone help and say what is wrong ?
Just remove the $
from your regex, and escape the parentheses.
string.match(/^\([0-9]+\)/);
$
means end of string.
(
and )
are special character and should be escaped. Pharenthesis are used for grouping. You can find a list of special characters here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With