0

I am running this regex: ^https?:\/\/www\.chkhikvadze\.com\/[a-z0-9-/]+-[0-9]\.[0-9]{7}$ and getting this error: My sql error 1139 invalid character name.

when i remove this fragment [a-z0-9-/] or only -/ it works. how can i fix it?

2
  • Try ^https?://www[.]chkhikvadze[.]com/[a-z0-9/-]+-[0-9][.][0-9]{7}$ Commented Jan 31, 2017 at 12:30
  • escape the "-", "/" and ".": ^https?:\/\/www\.chkhikvadze\.com\/[a-z0-9\-\/]+\-[0-9]\.[0-9]{7}$ Commented Jan 31, 2017 at 12:40

1 Answer 1

1

Just put the dash in front:

^https?:\/\/www\.chkhikvadze\.com\/[-a-z0-9/]+-[0-9]\.[0-9]{7}$

The parser thinks that 9-/ is supposed to be a range like a-z, but complains that it's not valid.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.