web/src/main/java/org/springframework/security/web/authentication/preauth/x509/SubjectDnX509PrincipalExtractor.java
public void setSubjectDnRegex(String subjectDnRegex) {
		Assert.hasText(subjectDnRegex, "Regular expression may not be null or empty");
		subjectDnPattern = Pattern.compile(subjectDnRegex, Pattern.CASE_INSENSITIVE);
	}
public void setSubjectDnRegex(String subjectDnRegex) {
		Assert.hasText(subjectDnRegex, "Regular expression may not be null or empty");
		subjectDnPattern = Pattern.compile(subjectDnRegex, Pattern.CASE_INSENSITIVE);
	}
public void setSubjectDnRegex ( String subjectDnRegex ) { Assert . hasText ( subjectDnRegex , "Regular expression may not be null or empty" ) ; subjectDnPattern = Pattern . compile ( subjectDnRegex , Pattern . CASE_INSENSITIVE ) ; }
Sets the regular expression which will by used to extract the user name from the
certificate's Subject DN.
<p>
It should contain a single group; for example the default expression
"CN=(.*?)(?:,|$)" matches the common name field. So "CN=Jimi Hendrix, OU=..." will
give a user name of "Jimi Hendrix".
<p>
The matches are case insensitive. So "emailAddress=(.?)," will match
"EMAILADDRESS=jimi@hendrix.org, CN=..." giving a user name "jimi@hendrix.org"

@param subjectDnRegex the regular expression to find in the subject
Sets the regular expression which will by used to extract the user name from the certificate s Subject DN . <p > It should contain a single group ; for example the default expression CN = ( . * ? ) ( ? : |$ ) matches the common name field . So CN = Jimi Hendrix OU = ... will give a user name of Jimi Hendrix . <p > The matches are case insensitive . So emailAddress = ( . ? ) will match EMAILADDRESS = jimi@hendrix . org CN = ... giving a user name jimi@hendrix . org