Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8027949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:58:30+00:00 2026-06-04T23:58:30+00:00

I have a password box that I am going to check against a Regex

  • 0

I have a password box that I am going to check against a Regex pattern. I have already got two other identical type of functions that work correctly on non password text boxes.

This is my function:

public bool CheckPassword(string password)
{
    string patternStrict = @"/^(?=.*[a-zA-Z])(?=.*\d)\S{6,15}$/";
    Regex reStrict = new Regex(patternStrict);
    bool isStrictMatch = reStrict.IsMatch(password);
    return isStrictMatch;
}

and I am inputting a test to it like so:

Problem.Text = CheckPassword(passwordbox.Text);

The TextBox I am using (passwordbox) is filtered with * as the password character and that works but I am wondering if that is the cause for the function to fail?

I feel it is something obvious I have missed. The response should come back as true but it is coming back as false. See line 5 of the link supplied above as the test line to see if it works, that is the test line I am using to check if it works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T23:58:31+00:00Added an answer on June 4, 2026 at 11:58 pm

    .NET does not need a regex delimiter, so just remove the leading and the trailing slash:

    string patternStrict = @"^(?=.*[a-zA-Z])(?=.*\d)\S{6,15}$";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In this blog, http://www.bswebdev.com/2008/12/javascript-change-input-box-type-to-password/ I have found the following snippets for fixing change input
I have a login form that contains a username textbox and a password box.
I have about had it with this tool, I check the save password box
In my application, I have created a dialog box to accept password. In the
I have a Password Reset Functionality ,I have to check whether Old and New
I have a login box that I need to have submitted when enter is
I have an input box that is part of my log in functionality. I
My application has a restricted access. I have a user/password box in a small
I have a samba network share on a FreeBSD box that I use for
I have a password protected website running on WinCE that, upon attempting to access

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.