@Override
    protected void check(Shape shape, PatternTrait trait, StringNode node, Context context, Emitter emitter) {
        if (!trait.getPattern().matcher(node.getValue()).find()) {
            emitter.accept(node,
                    getSeverity(context),
                    String.format(
                            "String value provided for `%s` must match regular expression: %s",
                            shape.getId(),
                            trait.getPattern().pattern()));
        }
    }
Validates the pattern trait on string shapes or members that target them.
smithy-model/src/main/java/software/amazon/smithy/model/validation/node/PatternTraitPlugin.java