-1

I have tried /^[^^]+$/, it is not allowing ^, but also not allowing some special characters like <>( that I want to allow.

Is there any regex that only not allow just one sign (^)?

wp78de
  • 18,207
  • 7
  • 43
  • 71
Fawad Ali
  • 564
  • 6
  • 11

1 Answers1

-1

/\^/g will match all instances of the "hat" character.

/[^^]/g will match all characters that are not the "hat" character.

Using +$ looks for one or more matching at the end of the string.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

https://regex101.com/

Alan Larimer
  • 589
  • 8
  • 24