public GetCustomDataIdentifierResult withRegex(String regex) {
        setRegex(regex);
        return this;
    }
<p>
The regular expression (<i>regex</i>) that defines the pattern to match.
</p>

@param regex
       The regular expression (<i>regex</i>) that defines the pattern to match.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-macie2/src/main/java/com/amazonaws/services/macie2/model/GetCustomDataIdentifierResult.java