1

I want to create a simple regex in which every character is possible except special characters.

For example,I dont want the "new line char" \n\r to be in the string.

I already have read about negative lookahead but It didn't work for me.

kitsuneFox
  • 1,093
  • 3
  • 14
  • 30
  • You do not need a lookahead, you need a [**negated character class**](https://www.regular-expressions.info/charclass.html#negated) + [**anchors**](https://www.regular-expressions.info/anchors.html). Go to the linked question, and you will find an example of such a regex near *a string containing specific character* section. Test your pattern at http://regex101.com, and if you have trouble, come back here and update the post. – Wiktor Stribiżew May 08 '18 at 07:26

0 Answers0