I have script here and ng-pattern works correctly because scope.subnet is shown in Output only after input matches pattern. But ng-show doesn't display any error if ng-pattern is not matched
<body ng-contoller=myConfigGenCtr>
<form novalidate name=myForm>
<div class=form-group>
<label for=hostname>Firewall hostname</label>
<input type=text ng-model=hostname class=form-control id=hostname>
</div>
<div class=form-group>
<label for=subnet>Firewall subnet</label>
<input type=text ng-model=subnet class=form-control id=subnet
required ng-pattern=/^(?:[0-9]{1,3}.){3}/ >
<div class=custom-error ng-show=myForm.subnet.$error.pattern>
Not a valid subnet, should be i.e. 10.x.y. (3 bytes only)</div>
</div>
</form>
<div>Output: {{subnet}}</div>
</body>