Invalid escape sequence in ^[SFTG]\d{7}[A-Z]$

Pattern .compile("^[SFTG]\d{7}[A-Z]$");

try like this:

"^[SFTG]\\d{7}[A-Z]$"

How to enable [A-Z] and a-z

[A-Z a-z]

Okay thanks how abt contact no is 8 digits starting must be 8 or 9 and las digit is 0-9

it would be easier if you looked it up and learned regex. there are tons of sites where you can easily learn, try and test.
this one, for instance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.