Hello guys. am new to regular expression.
I have comma seperated list of regular expressions like: .{8},[0-9],[^0-9A-Za-z ],[A-Z],[a-z]
. I have done a split on the comma. Now am trying to match of this regex against a generated password. The problem is that Pattern.compile does not like square brackets that is not escaped. Can some please give me a simple function that takes a string as so: [0-9]
and returns the escaped string \[0-9\]
. Thanks again