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

  • Home
  • SEARCH
  • 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 7556497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:52:20+00:00 2026-05-30T11:52:20+00:00

Before you mark this as answered in another post (I already saw those). But

  • 0

Before you mark this as answered in another post (I already saw those). But in none of them they specifically say the REGEX they suggest works for C# (I think they focus more on Javascript). Now I am not too good with regex but I would appreciate any help determining how to get the type and once I get the regex how can I validate the cc entered against the regex?

I saw this as an answer in many of the posts here in StackOverflow, but would this work in C# (same code) if yes how can i compare my creditCard string to the regex?

Get Card Type based on number

I would really appreciate any help, this is the first time i deal with credit card validation, just need to get the type. Drop down is out of the question based on the feedback from the person needing it.

  • 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-05-30T11:52:22+00:00Added an answer on May 30, 2026 at 11:52 am

    Any of the regular expressions on that page will work in C#. For example:

    string isVisa = "^4[0-9]{12}(?:[0-9]{3})?$";
    string ccnumber = "1234123412341234";
    
    if (System.Text.RegularExpressions.Regex.IsMatch(ccnumber, isVisa)) {
      // valid Visa card
    }
    

    A program I always recommend to test out regular expressions in C# is Expresso. You will be able to test out any of the credit card number validation patterns in that program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Before you mark this as a duplicate of this post, know that I am
There have been a few questions like this around the place but none have
I've done an NSXML Parser before, but for some reason this time my NSXMLParserDelegate
I'm sure this must have been asked before but I can't seem to find
This is a crazy question but basically we need to mark the first row
I have definitely done something like this before, but something is not working right
In the social network movie i saw Mark used Elo rating system But was
Please read this entire question before you try to mark this as too controversial.
Before you mark this as a duplicate of JQuery: elegant way to replace set
I am quite fine with iPhone and have done this before but can't figure

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.