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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:51:56+00:00 2026-05-23T17:51:56+00:00

I have 2 strings and want to know if string 2 have a subset

  • 0

I have 2 strings and want to know

  1. if string 2 have a subset of the characters of string 1 on the
    same order

  2. this subset has a minimun size determined by me.

For example:

string 1 = stackoverflow
<br>minimun size = 5

string 2a = stack (MATCH)
string 2b = stac  (DO NOT MATCH)
string 2c = staov (MATCH)
string 2d = staZov (DO NOT MATCH)
string 2e = eflow (MATCH) 
string 2f = ewolf (DO NOT MATCH)
string 2g = somethingstacksomething (MATCH) 

I am building the regex programatically, so the first part of the problem could be solved with the expression: (s)?(t)?(a)?(c)?(k)?(o)?(v)?(e)?(r)?(f)?(l)?(o)?(w)?

But i can’t figure out how to apply the “minimun character” rule. Is it possible to do it using regex?

thanks in advance!

EDIT: Added another example to complete the problem specification. Also, if you want to know, this is part of a method to evaluate the password strength specified by a user. If he defines a password derived from some other information (login, born date, name, etc) we should warn him.

  • 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-23T17:51:57+00:00Added an answer on May 23, 2026 at 5:51 pm

    You could add a lookahead that ensures that there are five characters: (?=.{5})s?t?a?c?k?o?v?e?r?f?l?o?w?

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

Sidebar

Related Questions

I have an ArrayList<String> , and I want to remove repeated strings from it.
I have string like this /c SomeText\MoreText Some Text\More Text\Lol SomeText I want to
I have strings that look like this example: AAABBBCDEEEEBBBAA Any character is possible in
I want to know that I have the string.xml Resource file which contains status
I have two strings <EM>is <i>love</i></EM>,<PARTITION /> and <EM>is <i>love</i>,<PARTITION /> I want a
I have a List of strings that is regenerated every 5 seconds. I want
I have string that I want to chop to array of substrings of given
Imagine I have String in C#: I Don’t see ya.. I want to remove
In Java, I have a String and I want to encode it as a
I have a string (char) and I want to extract numbers out of it.

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.