Advertisement:

Author Topic: Custom profile field input mask regex help  (Read 250 times)

Offline TurtleKicker

  • Full Member
  • ***
  • Posts: 416
Custom profile field input mask regex help
« on: February 21, 2019, 11:32:12 PM »
Ok, I suck at this regex stuff. Can't wrap my head around how to do what I want based upon the resources I've found.

Goal: input field with text in the format nnnn-nnnn-nnnn
So 3 sets of 4 numeric digits, separated by 2 hyphens.

Something like:
Code: [Select]
~[0-9]{4}-[0-9]{4}-[0-9]{4}~
Is that right?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,614
    • StoryBB/StoryBB on GitHub
Re: Custom profile field input mask regex help
« Reply #1 on: February 22, 2019, 02:38:36 AM »
Looks right to me.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.