CORE-4015:
* Added null check to value
* Added support for excluding newline for restricted chars