I use netbeans, I try to replace \\ with \\\\ but it fails , it can\'t escape the \\\\ character.
This is not a Netbeans issu
Use 4 backslashes and please don't forget the delimiters:
echo echo preg_replace('~\\\\~','\\\\\\\\','text to \\ be parsed');
Online demo
Explanation: When PHP parse \\\\ it will escape \\ two times, which means it becomes \\, now when PHP passes it to the regex engine, it will receive \\ which means \.