-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
  • 16,078
  • 6
  • 34
  • 56
Fawad Ali
  • 500
  • 5
  • 10

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
  • 584
  • 7
  • 24