I have a regular expression
regex = '[\w!\-$%^&*()_+|~=`{}\[\]:";\'<>?,.@#\\/]+' When i try to match the regular expression with a string for example
password = '\Gs7iCHE' no match is found but when i change the regular expression to
regex = '[\w!\-$%^&*()_+|~=`{}\[\]:";\'<>?,.@#\\\\/]+' it finds a match which is
match = '\\Gs7iCHE' I dont know why the behavior is this way.
\needs to be escaped to have it in a string. And since the escaped\needs to be escaped in the character set, you have to enter\\\\. In your first case it escapes the/.wand adds a range!-$.