Regular Expression validation IssuesHow to validate an email address in JavaScript?What are valid values for the id attribute in HTML?What is the best regular expression to check if a string is a valid URL?Is there a regular expression to detect a valid regular expression?How to validate an email address using a regular expression?Regular expression to match a line that doesn't contain a wordHow do you access the matched groups in a JavaScript regular expression?Regular Expressions: Is there an AND operator?How do you use a variable in a regular expression?Regex to validate password strength
How do I write real-world stories separate from my country of origin?
Keeping the dodos out of the field
Is a world with one country feeding everyone possible?
Why is Ni[(PPh₃)₂Cl₂] tetrahedral?
What is the required burn to keep a satellite at a Lagrangian point?
How many wires should be in a new thermostat cable?
nginx conf: http2 module not working in Chrome in ubuntu 18.04
Is there any mention of ghosts who live outside the Hogwarts castle?
"Official wife" or "Formal wife"?
Why did Nick Fury not hesitate in blowing up the plane he thought was carrying a nuke?
Way of refund if scammed?
Proto-Indo-European (PIE) words with IPA
Is ideal gas incompressible?
Are there any tips to help hummingbirds find a new feeder?
How could the B-29 bomber back up under its own power?
If change in free energy (G) is positive, how do those reactions still occur?
Team member is vehemently against code formatting
Ratings matrix plot
Why do the i8080 I/O instructions take a byte-sized operand to determine the port?
Find this Unique UVC Palindrome ( ignoring signs and decimal) from Given Fractional Relationship
Wifi light switch needs neutral wire. Why? AND Can that wire be a skinny one?
Does science define life as "beginning at conception"?
Is there a word for pant sleeves?
If a character has cast the Fly spell on themselves, can they "hand off" to the Levitate spell without interruption?
Regular Expression validation Issues
How to validate an email address in JavaScript?What are valid values for the id attribute in HTML?What is the best regular expression to check if a string is a valid URL?Is there a regular expression to detect a valid regular expression?How to validate an email address using a regular expression?Regular expression to match a line that doesn't contain a wordHow do you access the matched groups in a JavaScript regular expression?Regular Expressions: Is there an AND operator?How do you use a variable in a regular expression?Regex to validate password strength
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm using the
^(?=^.14,30$)(?=^.[d]3$)(?=^.[a-z]4$)(?=^.[A-Z]5$)(?=^.[!*&#$%^]2).$
regular expression in order to validate the following as minimum requirements:
- Four low case letter
- Five Upper case letters
- Three digits
- Two special characters
- With total length between 14 to 30 characters long
But Unfortunately This validation pattern doesn't validate my string.
I've look for regex
pattern validation and gives me that the pattern is OK
Can someone give me a support on this?
html regex vb.net
add a comment |
I'm using the
^(?=^.14,30$)(?=^.[d]3$)(?=^.[a-z]4$)(?=^.[A-Z]5$)(?=^.[!*&#$%^]2).$
regular expression in order to validate the following as minimum requirements:
- Four low case letter
- Five Upper case letters
- Three digits
- Two special characters
- With total length between 14 to 30 characters long
But Unfortunately This validation pattern doesn't validate my string.
I've look for regex
pattern validation and gives me that the pattern is OK
Can someone give me a support on this?
html regex vb.net
Four lower case letters or at least four? Consecutive or at any location? Your pattern is a mess.(?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after^
and lookaheads, there is.
before$
, so actually, the whole regex can match a single char string.
– Wiktor Stribiżew
Mar 23 at 21:13
add a comment |
I'm using the
^(?=^.14,30$)(?=^.[d]3$)(?=^.[a-z]4$)(?=^.[A-Z]5$)(?=^.[!*&#$%^]2).$
regular expression in order to validate the following as minimum requirements:
- Four low case letter
- Five Upper case letters
- Three digits
- Two special characters
- With total length between 14 to 30 characters long
But Unfortunately This validation pattern doesn't validate my string.
I've look for regex
pattern validation and gives me that the pattern is OK
Can someone give me a support on this?
html regex vb.net
I'm using the
^(?=^.14,30$)(?=^.[d]3$)(?=^.[a-z]4$)(?=^.[A-Z]5$)(?=^.[!*&#$%^]2).$
regular expression in order to validate the following as minimum requirements:
- Four low case letter
- Five Upper case letters
- Three digits
- Two special characters
- With total length between 14 to 30 characters long
But Unfortunately This validation pattern doesn't validate my string.
I've look for regex
pattern validation and gives me that the pattern is OK
Can someone give me a support on this?
html regex vb.net
html regex vb.net
edited Mar 24 at 11:32
Lefteris Gkinis
asked Mar 23 at 21:09
Lefteris GkinisLefteris Gkinis
64642258
64642258
Four lower case letters or at least four? Consecutive or at any location? Your pattern is a mess.(?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after^
and lookaheads, there is.
before$
, so actually, the whole regex can match a single char string.
– Wiktor Stribiżew
Mar 23 at 21:13
add a comment |
Four lower case letters or at least four? Consecutive or at any location? Your pattern is a mess.(?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after^
and lookaheads, there is.
before$
, so actually, the whole regex can match a single char string.
– Wiktor Stribiżew
Mar 23 at 21:13
Four lower case letters or at least four? Consecutive or at any location? Your pattern is a mess.
(?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after ^
and lookaheads, there is .
before $
, so actually, the whole regex can match a single char string.– Wiktor Stribiżew
Mar 23 at 21:13
Four lower case letters or at least four? Consecutive or at any location? Your pattern is a mess.
(?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after ^
and lookaheads, there is .
before $
, so actually, the whole regex can match a single char string.– Wiktor Stribiżew
Mar 23 at 21:13
add a comment |
3 Answers
3
active
oldest
votes
Note that (?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after ^
and lookaheads, there is .
before $
, so actually, the whole regex can match a single char string.
You may use
^(?=(?:D*d)3)(?=(?:[^a-z]*[a-z])4)(?=(?:[^A-Z]*[A-Z])5)(?=(?:[^!*&#$%^]*[!*&#$%^])2).8,30$
See the regex demo. A regulex graph:
Details
^
- start of string(?=(?:D*d)3)
- three occurrences of any 0+ non-digits followed with a digit(?=(?:[^a-z]*[a-z])4)
- four occurrences of any 0+ chars other than a lowercase ASCII letters followed with a lowercase ASCII letter(?=(?:[^A-Z]*[A-Z])5)
- five occurrences of any 0+ chars other than an uppercase ASCII letters followed with an uppercase ASCII letter(?=(?:[^!*&#$%^]*[!*&#$%^])2)
- two occurrences of any 0+ chars other than some specific special chars (defined in the character class) followed with a char from the sepcified!*&#$%^
set.8,30
- any 8 to 30 chars$
- end of string.
add a comment |
^(?=.14,30$)(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).*$
└─────┬─────┘└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │ │
│ │ │ │ 2 special characters
│ │ │ │
│ │ │ 3 digits
│ │ │
│ │ 4 lowercase letters
│ │
│ 5 uppercase letters
│
string is 14-30 characters long
^(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).(14,30)$
└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │
│ │ │ 2 special characters
│ │ │
│ │ 3 digits
│ │
│ 4 lowercase letters
│
5 uppercase letters
add a comment |
Instead of a regex, which may be difficult to maintain, how about some simple code that is easy to read and modify:
Private Function IsStringValid(s As String) As Boolean
If (s.Length > 30) OrElse (s.Length < 14) Then
Return False
End If
Dim lower, upper, digit, special As Integer
For Each c As Char In s
Select Case True
Case Char.IsLower(c)
lower += 1
Case Char.IsUpper(c)
upper += 1
Case Char.IsDigit(c)
digit += 1
Case Char.IsSymbol(c) OrElse Char.IsPunctuation(c)
special += 1
End Select
Next
Return (lower >= 4) AndAlso (upper >= 5) AndAlso (digit >= 3) AndAlso (special >= 2)
End Function
Based on your requirements, the minimum length has to be 14.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318414%2fregular-expression-validation-issues%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Note that (?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after ^
and lookaheads, there is .
before $
, so actually, the whole regex can match a single char string.
You may use
^(?=(?:D*d)3)(?=(?:[^a-z]*[a-z])4)(?=(?:[^A-Z]*[A-Z])5)(?=(?:[^!*&#$%^]*[!*&#$%^])2).8,30$
See the regex demo. A regulex graph:
Details
^
- start of string(?=(?:D*d)3)
- three occurrences of any 0+ non-digits followed with a digit(?=(?:[^a-z]*[a-z])4)
- four occurrences of any 0+ chars other than a lowercase ASCII letters followed with a lowercase ASCII letter(?=(?:[^A-Z]*[A-Z])5)
- five occurrences of any 0+ chars other than an uppercase ASCII letters followed with an uppercase ASCII letter(?=(?:[^!*&#$%^]*[!*&#$%^])2)
- two occurrences of any 0+ chars other than some specific special chars (defined in the character class) followed with a char from the sepcified!*&#$%^
set.8,30
- any 8 to 30 chars$
- end of string.
add a comment |
Note that (?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after ^
and lookaheads, there is .
before $
, so actually, the whole regex can match a single char string.
You may use
^(?=(?:D*d)3)(?=(?:[^a-z]*[a-z])4)(?=(?:[^A-Z]*[A-Z])5)(?=(?:[^!*&#$%^]*[!*&#$%^])2).8,30$
See the regex demo. A regulex graph:
Details
^
- start of string(?=(?:D*d)3)
- three occurrences of any 0+ non-digits followed with a digit(?=(?:[^a-z]*[a-z])4)
- four occurrences of any 0+ chars other than a lowercase ASCII letters followed with a lowercase ASCII letter(?=(?:[^A-Z]*[A-Z])5)
- five occurrences of any 0+ chars other than an uppercase ASCII letters followed with an uppercase ASCII letter(?=(?:[^!*&#$%^]*[!*&#$%^])2)
- two occurrences of any 0+ chars other than some specific special chars (defined in the character class) followed with a char from the sepcified!*&#$%^
set.8,30
- any 8 to 30 chars$
- end of string.
add a comment |
Note that (?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after ^
and lookaheads, there is .
before $
, so actually, the whole regex can match a single char string.
You may use
^(?=(?:D*d)3)(?=(?:[^a-z]*[a-z])4)(?=(?:[^A-Z]*[A-Z])5)(?=(?:[^!*&#$%^]*[!*&#$%^])2).8,30$
See the regex demo. A regulex graph:
Details
^
- start of string(?=(?:D*d)3)
- three occurrences of any 0+ non-digits followed with a digit(?=(?:[^a-z]*[a-z])4)
- four occurrences of any 0+ chars other than a lowercase ASCII letters followed with a lowercase ASCII letter(?=(?:[^A-Z]*[A-Z])5)
- five occurrences of any 0+ chars other than an uppercase ASCII letters followed with an uppercase ASCII letter(?=(?:[^!*&#$%^]*[!*&#$%^])2)
- two occurrences of any 0+ chars other than some specific special chars (defined in the character class) followed with a char from the sepcified!*&#$%^
set.8,30
- any 8 to 30 chars$
- end of string.
Note that (?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after ^
and lookaheads, there is .
before $
, so actually, the whole regex can match a single char string.
You may use
^(?=(?:D*d)3)(?=(?:[^a-z]*[a-z])4)(?=(?:[^A-Z]*[A-Z])5)(?=(?:[^!*&#$%^]*[!*&#$%^])2).8,30$
See the regex demo. A regulex graph:
Details
^
- start of string(?=(?:D*d)3)
- three occurrences of any 0+ non-digits followed with a digit(?=(?:[^a-z]*[a-z])4)
- four occurrences of any 0+ chars other than a lowercase ASCII letters followed with a lowercase ASCII letter(?=(?:[^A-Z]*[A-Z])5)
- five occurrences of any 0+ chars other than an uppercase ASCII letters followed with an uppercase ASCII letter(?=(?:[^!*&#$%^]*[!*&#$%^])2)
- two occurrences of any 0+ chars other than some specific special chars (defined in the character class) followed with a char from the sepcified!*&#$%^
set.8,30
- any 8 to 30 chars$
- end of string.
edited Mar 23 at 21:35
answered Mar 23 at 21:30
Wiktor StribiżewWiktor Stribiżew
1
1
add a comment |
add a comment |
^(?=.14,30$)(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).*$
└─────┬─────┘└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │ │
│ │ │ │ 2 special characters
│ │ │ │
│ │ │ 3 digits
│ │ │
│ │ 4 lowercase letters
│ │
│ 5 uppercase letters
│
string is 14-30 characters long
^(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).(14,30)$
└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │
│ │ │ 2 special characters
│ │ │
│ │ 3 digits
│ │
│ 4 lowercase letters
│
5 uppercase letters
add a comment |
^(?=.14,30$)(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).*$
└─────┬─────┘└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │ │
│ │ │ │ 2 special characters
│ │ │ │
│ │ │ 3 digits
│ │ │
│ │ 4 lowercase letters
│ │
│ 5 uppercase letters
│
string is 14-30 characters long
^(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).(14,30)$
└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │
│ │ │ 2 special characters
│ │ │
│ │ 3 digits
│ │
│ 4 lowercase letters
│
5 uppercase letters
add a comment |
^(?=.14,30$)(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).*$
└─────┬─────┘└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │ │
│ │ │ │ 2 special characters
│ │ │ │
│ │ │ 3 digits
│ │ │
│ │ 4 lowercase letters
│ │
│ 5 uppercase letters
│
string is 14-30 characters long
^(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).(14,30)$
└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │
│ │ │ 2 special characters
│ │ │
│ │ 3 digits
│ │
│ 4 lowercase letters
│
5 uppercase letters
^(?=.14,30$)(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).*$
└─────┬─────┘└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │ │
│ │ │ │ 2 special characters
│ │ │ │
│ │ │ 3 digits
│ │ │
│ │ 4 lowercase letters
│ │
│ 5 uppercase letters
│
string is 14-30 characters long
^(?=(?:.*[A-Z])5)(?=(?:.*[a-z])4)(?=(?:.*d)3)(?=(?:.*[!*&#$%^])2).(14,30)$
└───────┬────────┘└───────┬────────┘└──────┬──────┘└─────────┬──────────┘
│ │ │ │
│ │ │ 2 special characters
│ │ │
│ │ 3 digits
│ │
│ 4 lowercase letters
│
5 uppercase letters
edited Mar 24 at 13:01
answered Mar 23 at 21:56
ΩmegaΩmega
27.7k2289159
27.7k2289159
add a comment |
add a comment |
Instead of a regex, which may be difficult to maintain, how about some simple code that is easy to read and modify:
Private Function IsStringValid(s As String) As Boolean
If (s.Length > 30) OrElse (s.Length < 14) Then
Return False
End If
Dim lower, upper, digit, special As Integer
For Each c As Char In s
Select Case True
Case Char.IsLower(c)
lower += 1
Case Char.IsUpper(c)
upper += 1
Case Char.IsDigit(c)
digit += 1
Case Char.IsSymbol(c) OrElse Char.IsPunctuation(c)
special += 1
End Select
Next
Return (lower >= 4) AndAlso (upper >= 5) AndAlso (digit >= 3) AndAlso (special >= 2)
End Function
Based on your requirements, the minimum length has to be 14.
add a comment |
Instead of a regex, which may be difficult to maintain, how about some simple code that is easy to read and modify:
Private Function IsStringValid(s As String) As Boolean
If (s.Length > 30) OrElse (s.Length < 14) Then
Return False
End If
Dim lower, upper, digit, special As Integer
For Each c As Char In s
Select Case True
Case Char.IsLower(c)
lower += 1
Case Char.IsUpper(c)
upper += 1
Case Char.IsDigit(c)
digit += 1
Case Char.IsSymbol(c) OrElse Char.IsPunctuation(c)
special += 1
End Select
Next
Return (lower >= 4) AndAlso (upper >= 5) AndAlso (digit >= 3) AndAlso (special >= 2)
End Function
Based on your requirements, the minimum length has to be 14.
add a comment |
Instead of a regex, which may be difficult to maintain, how about some simple code that is easy to read and modify:
Private Function IsStringValid(s As String) As Boolean
If (s.Length > 30) OrElse (s.Length < 14) Then
Return False
End If
Dim lower, upper, digit, special As Integer
For Each c As Char In s
Select Case True
Case Char.IsLower(c)
lower += 1
Case Char.IsUpper(c)
upper += 1
Case Char.IsDigit(c)
digit += 1
Case Char.IsSymbol(c) OrElse Char.IsPunctuation(c)
special += 1
End Select
Next
Return (lower >= 4) AndAlso (upper >= 5) AndAlso (digit >= 3) AndAlso (special >= 2)
End Function
Based on your requirements, the minimum length has to be 14.
Instead of a regex, which may be difficult to maintain, how about some simple code that is easy to read and modify:
Private Function IsStringValid(s As String) As Boolean
If (s.Length > 30) OrElse (s.Length < 14) Then
Return False
End If
Dim lower, upper, digit, special As Integer
For Each c As Char In s
Select Case True
Case Char.IsLower(c)
lower += 1
Case Char.IsUpper(c)
upper += 1
Case Char.IsDigit(c)
digit += 1
Case Char.IsSymbol(c) OrElse Char.IsPunctuation(c)
special += 1
End Select
Next
Return (lower >= 4) AndAlso (upper >= 5) AndAlso (digit >= 3) AndAlso (special >= 2)
End Function
Based on your requirements, the minimum length has to be 14.
edited Mar 25 at 3:41
Cody Gray♦
197k36388478
197k36388478
answered Mar 23 at 23:44
MaryMary
4,53621021
4,53621021
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318414%2fregular-expression-validation-issues%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Four lower case letters or at least four? Consecutive or at any location? Your pattern is a mess.
(?=^.[a-z]4$)
requires a match of a 5 char string where the first one csn be any char and then there must be 4 lowercase letters. In the end, after^
and lookaheads, there is.
before$
, so actually, the whole regex can match a single char string.– Wiktor Stribiżew
Mar 23 at 21:13