Note that there are some explanatory texts on larger screens.

plurals
  1. POCakePHP Validate Masked Credit Card With Regex
    primarykey
    data
    text
    <p>I am creating an update billing information section for my users. I am currently passing a masked credit card number to the form. I do not want the user to have to update their credit card information if they only want to update say their billing address.</p> <p>I am attempting to use regex to match the masked credit card, but I have not been able to get ANY regex patterns to match... Even 100% wildcards...</p> <p>Here are couple of examples of what I have tried...</p> <p>================================================================</p> <p>The Masked Credit Card Value Is XXXXXXXXXXXX0012</p> <p>================================================================</p> <pre><code>'creditcard' =&gt; array( 'creditcard' =&gt; array( 'rule' =&gt; array('cc', 'all', false, '^[.]+$'), 'message' =&gt; 'Required', 'allowEmpty' =&gt; false, 'required' =&gt; true, ), ), </code></pre> <p>================================================================</p> <pre><code> 'creditcard' =&gt; array( 'creditcard' =&gt; array( 'rule' =&gt; array('cc', 'all', false, '/^[X]+[0-9](4,)$/'), 'message' =&gt; 'Required', 'allowEmpty' =&gt; false, 'required' =&gt; true, ), ), </code></pre> <p>================================================================</p> <pre><code> 'creditcard' =&gt; array( 'creditcard' =&gt; array( 'rule' =&gt; array('cc', 'all', false, '/^[x]+[0-9]+$/i'), 'message' =&gt; 'Required', 'allowEmpty' =&gt; false, 'required' =&gt; true, ), ), </code></pre> <p>Any Ideas Are Greatly Appreciated!</p> <p>Thank You!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload