Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    How to write regex with javascript

    Web Development
    javascript regex web development
    2
    4
    892
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Harsha Sampath
      Harsha Sampath Web Development last edited by

      Hi devs, I have to validate username with this format "xxxxxxxx_0000000". x = any character, 0 = any number. How can I do it with javascript?

      1 Reply Last reply Reply Quote 0
      • dev_lak
        dev_lak last edited by

        try, /[a-zA-Z]{8}[_]{1}[0-9]{7}$/g

        1 Reply Last reply Reply Quote 6
        • Harsha Sampath
          Harsha Sampath Web Development last edited by

          Awesome! Thanks, mate

          1 Reply Last reply Reply Quote 0
          • dev_lak
            dev_lak last edited by

            welcome bro...

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post

            0
            Online

            3.6k
            Users

            1.3k
            Topics

            5.3k
            Posts

            • Privacy
            • Terms & Conditions
            • Donate

            © Copyrights and All right reserved Lanka Developers Community

            Powered by Axis Technologies (PVT) Ltd

            Made with in Sri Lanka

            | |