I gave my class a regex exercise to figure out a set of expressions that could match the password rules my bank uses. Here are the rules

  • A minimum of eight (8) characters not to exceed twelve (12). .
  • At least one alpha and one numeric character..
  • No special characters i.e., " ? * &, etc..
  • Can not contain a series of three sequential identical characters..
  • Be equal to or reverse of your USER ID.
  • Nobody (including me)has come up with anything simple for the forth rule (no 3 sequential identical). I was thinking that I could use backreferences and compare them in a loop but was wondering if there was a simpler way.

    Time flies like an arrow, fruit flies like banannas


    In reply to Regex Match for 3 repeated word characters by hsweet

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.