Anyway, I created a hash (incomplete, but just to get the idea) with the translations to normal language: So I want to match the key to the error, and I came up with this, but it never matches:00000056: AtrErr: DSID-03190F80, #1: 0: 00000056: DSID-03190F80, problem 1005 (CONSTRAINT_ATT_TYPE), da +ta 0, Att 9005a (unicodePwd)
Edit: I updated the question with a piece of code. The $error comes from the actual error method in Net::LDAP and if I add [] to print it it actually looks like this:
with the last ']' as only character in the line.[00000056: AtrErr: DSID-03190F80, #1: 0: 00000056: DSID-03190F80, problem 1005 (CONSTRAINT_ATT_TYPE), da +ta 0, Att 9005a (unicodePwd) ]
But it is obviously not working. What is wrong with my crappy regular expression? :-) Thanks in advance$error = "00000056: AtrErr: DSID-03190F80, #1: 0: 00000056: DSID-03190F80, problem 1005 (CONSTRAINT_ATT_TYPE), da +ta 0, Att 9005a (unicodePwd) "; my %pwd_reset_errors = ( '0000052D' => "new password does not meet complexity requirements" +, '00000056' => "wrong old password", ); while ( my ( $key, $value ) = each %pwd_reset_errors ) { if ( $key =~ m/^$error.*/ ) { app->log->debug("$value"); } }
In reply to regex match multiple line (updated question) by natxo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |