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 230439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:50:58+00:00 2026-05-11T19:50:58+00:00

I’m trying to think of a regular expression for this but not having any

  • 0

I’m trying to think of a regular expression for this but not having any luck..

Let’s say you have a security question on you website so the person can recover a password. People often forget exactly how they entered information. For example, given the question “What company do you work for?”, a user might answer “Microsoft Corp.”. But a month later when they are prompted to answer this question, they might type in “Microsoft”, which wouldn’t match their original answer even though they clearly answered correctly.

“Microsoft Corp.” or “Microsoft Inc.” or “Microsoft Co.” would match “Microsoft”, and “questar gas” would match “Questar Gas Co.”. “Bank Corp. of America” would NOT match “Bank of America” because the word “Corp.” is not at the end of the string.

What is the best way to accomplish this?

  • 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-11T19:50:58+00:00Added an answer on May 11, 2026 at 7:50 pm

    I wouldn’t worry too much about people changing their answers. People are remarkably consistant in how they answer these kinds of questions. If I know your first job was at Microsoft, the fact that I type it slightly differently may suggest that I’m an attacker.

    Avoid placing plaintext answers in your database. This is similar to storing plaintext passwords, which is definately a bad idea. If your database, or a backup of the database, gets out of your control, then you have a leak of your client’s private information. Maybe it won’t fall into the wrong hands, but think of the email you’ll have to send to your users. “Change all the sites where you answered this question the same way.”

    Instead, take the salted hash of the answer, and store that in the database. When the user answers the question later, use the same algorithm to hash their answer, and compare to the stored value.

    You can use some normalization to minimize the effect of typos. You could convert to lowercase, and remove spaces and punctuation. For example, “Microsoft Corp.” would become “microsoftcorp”. That way, if a user decides to leave off the period or add another space, it would still match.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.