by IT2Be » Sun Feb 08, 2004 3:19 pm
Just to be a little more precise (not too much since this is not really my peace of cake)...
Not only is it part of the java regex but it is part of regexes in general...
The "\" is a special character that is used to start a match. '\w' matches all word character, '\d' matches all integers etc...
If you would use '\n' in this respect the regex function won't find a match because there is no such thing as '\n'. But if you want to search for '\n' you would do that like '\\n'.
Outside a regex the '\' is also used to start a special character in this case '\n' will find a match and let's say '\newdirectory' also but it wil be <linefeed>ewdirectory. You then again would have to use '\\newdirectory' to get the requested output...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and ServoyServoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy