Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
Is there a way to add the ']' special character in my regex, when it normally ends my proposition?

I am trying to fit ']' into my regex that lets any string pass as long as it doesn't have a certain set of special characters. However, the IDE shows me that it ends the expression:

message: Joi.string().regex(/^[^<>#*=+^}[]+$/).required()
//current working code


message: Joi.string().regex(/^[^<>#*=+^}[]]+$/).required()
//what I am trying to add
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

You can escape special character using \

So you can use: (/^[^<>#*=+^}[\]]+$/) which will escape the first ] allowing it to be viewed as a regular symbol.

If you are new to regular expressions, try regex101.com. It does a good job of breaking them down for you.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!