Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Alternate message problem with backslash #99

Description

@pabx06
<html><head>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="bower_components/foundation/css/foundation.min.css" />
</head><body>

<form id="signup-form" name="myForm" >
<!-- credit card EXP -->
          <div class="form-group  has-feedback" ng-class="{'has-error': myForm.ccdate.$invalid, 'has-success': !myForm.ccdate.$invalid}">
            <label for="ccdate">Date d'expiration de la carte, exemple: {{date | date:"MM/yyyy"}}</label>
            <input id="ccdate" type="text" class="form-control" name="ccdate" ng-model="formData.ccdate" validation="pattern=/^(0[1-9]|1[0-2])\/(20[0-9]{2})$/:alt=Doit etre de la forme MM/YYYY ou MM le mois sur chifres et YYYY année sur 4 chifres, exemple 12/2016" validation-error-to="myErrorId220">
            <span class="glyphicon form-control-feedback" aria-hidden="true" ng-class="{'glyphicon-remove': myForm.ccdate.$invalid, 'glyphicon-ok': !myForm.ccdate.$invalid}"></span>
            <small id="myErrorId220" class="error" style="padding: inherit"></small>
          </div>
</form>

The pathern is : https://regex101.com/r/gN5wH2/26

/^(0[1-9]|1[0-2])/(20[0-9]{2})$/

should match :
02/2013
02/2013
and should not match:
13/2030
02/1010
02/0010

but it does.
Am i doing something wrong ?

i started a jsfidle that i cant setup 100% OK :https://jsfiddle.net/jm1f9ee3/5/#&togetherjs=yw4SUscv8h

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions