Really vague Regex question: string that always iterates between uppercase and lowercase lettersHow do I make the first letter of a string uppercase in JavaScript?JavaScript - checking for any lowercase letters in a stringCMake Regex to convert lower case to upper caseRegex Match all characters between two stringsDoes this regex do what I think it does?How to check whether a string contains lowercase letter, uppercase letter, special character and digit?Match all uppercase words only if there's a lowercase in the string, with one regexCheck if string contains a uppercase letter “inside” itRegex: At least one uppercase char, one lowercase char, one digit and nothing elseRegex expression that excludes underscores, but only if they are right before a number or an uppercase letter?
Why is quantum entanglement surprising?
Why is c4 bad when playing the London against a King's Indian?
Their answer is discrete, mine is continuous. They baited me into the wrong answer. I have a P Exam question
How can I instantiate a lambda closure type in C++11/14?
What can plausibly explain many of my very long and low-tech bridges?
How could a government be implemented in a virtual reality?
Can a magnetic field of an object be stronger than its gravity?
PC video game involving floating islands doing aerial combat
Through what methods and mechanisms can a multi-material FDM printer operate?
Traffic law UK, pedestrians
What happens to foam insulation board after you pour concrete slab?
Pay as you go Or Oyster card
What's the correct term describing the action of sending a brand-new ship out into its first seafaring trip?
Importance sampling estimation of power function
What happens if you do emergency landing on a US base in middle of the ocean?
Do any instruments not produce overtones?
PhD student with mental health issues and bad performance
Why did Hela need Heimdal's sword?
Does an ice chest packed full of frozen food need ice? 18 day Grand Canyon trip
What happened to all the nuclear material being smuggled after the fall of the USSR?
Avoiding cliches when writing gods
C SIGINT signal in Linux
Payment instructions from HomeAway look fishy to me
Did Darth Vader wear the same suit for 20+ years?
Really vague Regex question: string that always iterates between uppercase and lowercase letters
How do I make the first letter of a string uppercase in JavaScript?JavaScript - checking for any lowercase letters in a stringCMake Regex to convert lower case to upper caseRegex Match all characters between two stringsDoes this regex do what I think it does?How to check whether a string contains lowercase letter, uppercase letter, special character and digit?Match all uppercase words only if there's a lowercase in the string, with one regexCheck if string contains a uppercase letter “inside” itRegex: At least one uppercase char, one lowercase char, one digit and nothing elseRegex expression that excludes underscores, but only if they are right before a number or an uppercase letter?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am stuck at a regEx problem that says "Make a regex that matches a string of 10 characters that always iterate between uppercase and lowercase letters."
The question is from a online quiz kind of thing, and when you input your response it tells you whether it is right or wrong.
I have tried a bunch of options but none of them work, as the question is a bit blurry for me.
([a-z][A-Z])5
([a-z][A-Z])5|([A-Z][a-z])5
According to me, I believe that the question simply wants us to match strings like AaAaAaAaAa
or aAaAaAaAaA
python regex
add a comment |
I am stuck at a regEx problem that says "Make a regex that matches a string of 10 characters that always iterate between uppercase and lowercase letters."
The question is from a online quiz kind of thing, and when you input your response it tells you whether it is right or wrong.
I have tried a bunch of options but none of them work, as the question is a bit blurry for me.
([a-z][A-Z])5
([a-z][A-Z])5|([A-Z][a-z])5
According to me, I believe that the question simply wants us to match strings like AaAaAaAaAa
or aAaAaAaAaA
python regex
How do you conclude that your latter attempt is wrong? What do you think is blurry about the question?
– tripleee
Mar 24 at 15:09
add a comment |
I am stuck at a regEx problem that says "Make a regex that matches a string of 10 characters that always iterate between uppercase and lowercase letters."
The question is from a online quiz kind of thing, and when you input your response it tells you whether it is right or wrong.
I have tried a bunch of options but none of them work, as the question is a bit blurry for me.
([a-z][A-Z])5
([a-z][A-Z])5|([A-Z][a-z])5
According to me, I believe that the question simply wants us to match strings like AaAaAaAaAa
or aAaAaAaAaA
python regex
I am stuck at a regEx problem that says "Make a regex that matches a string of 10 characters that always iterate between uppercase and lowercase letters."
The question is from a online quiz kind of thing, and when you input your response it tells you whether it is right or wrong.
I have tried a bunch of options but none of them work, as the question is a bit blurry for me.
([a-z][A-Z])5
([a-z][A-Z])5|([A-Z][a-z])5
According to me, I believe that the question simply wants us to match strings like AaAaAaAaAa
or aAaAaAaAaA
python regex
python regex
edited Mar 24 at 15:28
Harshdip Singh Deogan
asked Mar 24 at 14:39
Harshdip Singh DeoganHarshdip Singh Deogan
86
86
How do you conclude that your latter attempt is wrong? What do you think is blurry about the question?
– tripleee
Mar 24 at 15:09
add a comment |
How do you conclude that your latter attempt is wrong? What do you think is blurry about the question?
– tripleee
Mar 24 at 15:09
How do you conclude that your latter attempt is wrong? What do you think is blurry about the question?
– tripleee
Mar 24 at 15:09
How do you conclude that your latter attempt is wrong? What do you think is blurry about the question?
– tripleee
Mar 24 at 15:09
add a comment |
2 Answers
2
active
oldest
votes
I'm not sure about the code you need to incorporate this regexp in and id it suppose to get exactly 10 characters, but you are probably in the right direction. I think you can use this:
b(?:[a-z][A-Z]|[A-Z][a-z])5b
see online: https://regex101.com/r/bynUwn/1
add a comment |
Your current pattern matches a repetition of 5 times 2 characters but has no specific boundaries. What you might do is use word boundaries b([A-Z][a-z])5b
Another option could be to use anchors to assert the start and the end of the string and use a positive lookahead to assert the length of the string to 10:
^(?=.10$)[A-Z]?(?:[a-z][A-Z])+[a-z]?$
Explanation
^
Start of the string(?=[a-zA-Z]10$)
Assert lenght of 10 characters a-z[A-Z]?
Match optional uppercase char(?:[a-z][A-Z])+
Match 1+ times a lowercase char followed by an uppercase char[a-z]?
Match optional lowercase char$
End of string
Regex demo
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%2f55324913%2freally-vague-regex-question-string-that-always-iterates-between-uppercase-and-l%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I'm not sure about the code you need to incorporate this regexp in and id it suppose to get exactly 10 characters, but you are probably in the right direction. I think you can use this:
b(?:[a-z][A-Z]|[A-Z][a-z])5b
see online: https://regex101.com/r/bynUwn/1
add a comment |
I'm not sure about the code you need to incorporate this regexp in and id it suppose to get exactly 10 characters, but you are probably in the right direction. I think you can use this:
b(?:[a-z][A-Z]|[A-Z][a-z])5b
see online: https://regex101.com/r/bynUwn/1
add a comment |
I'm not sure about the code you need to incorporate this regexp in and id it suppose to get exactly 10 characters, but you are probably in the right direction. I think you can use this:
b(?:[a-z][A-Z]|[A-Z][a-z])5b
see online: https://regex101.com/r/bynUwn/1
I'm not sure about the code you need to incorporate this regexp in and id it suppose to get exactly 10 characters, but you are probably in the right direction. I think you can use this:
b(?:[a-z][A-Z]|[A-Z][a-z])5b
see online: https://regex101.com/r/bynUwn/1
answered Mar 24 at 14:54
izemizem
43357
43357
add a comment |
add a comment |
Your current pattern matches a repetition of 5 times 2 characters but has no specific boundaries. What you might do is use word boundaries b([A-Z][a-z])5b
Another option could be to use anchors to assert the start and the end of the string and use a positive lookahead to assert the length of the string to 10:
^(?=.10$)[A-Z]?(?:[a-z][A-Z])+[a-z]?$
Explanation
^
Start of the string(?=[a-zA-Z]10$)
Assert lenght of 10 characters a-z[A-Z]?
Match optional uppercase char(?:[a-z][A-Z])+
Match 1+ times a lowercase char followed by an uppercase char[a-z]?
Match optional lowercase char$
End of string
Regex demo
add a comment |
Your current pattern matches a repetition of 5 times 2 characters but has no specific boundaries. What you might do is use word boundaries b([A-Z][a-z])5b
Another option could be to use anchors to assert the start and the end of the string and use a positive lookahead to assert the length of the string to 10:
^(?=.10$)[A-Z]?(?:[a-z][A-Z])+[a-z]?$
Explanation
^
Start of the string(?=[a-zA-Z]10$)
Assert lenght of 10 characters a-z[A-Z]?
Match optional uppercase char(?:[a-z][A-Z])+
Match 1+ times a lowercase char followed by an uppercase char[a-z]?
Match optional lowercase char$
End of string
Regex demo
add a comment |
Your current pattern matches a repetition of 5 times 2 characters but has no specific boundaries. What you might do is use word boundaries b([A-Z][a-z])5b
Another option could be to use anchors to assert the start and the end of the string and use a positive lookahead to assert the length of the string to 10:
^(?=.10$)[A-Z]?(?:[a-z][A-Z])+[a-z]?$
Explanation
^
Start of the string(?=[a-zA-Z]10$)
Assert lenght of 10 characters a-z[A-Z]?
Match optional uppercase char(?:[a-z][A-Z])+
Match 1+ times a lowercase char followed by an uppercase char[a-z]?
Match optional lowercase char$
End of string
Regex demo
Your current pattern matches a repetition of 5 times 2 characters but has no specific boundaries. What you might do is use word boundaries b([A-Z][a-z])5b
Another option could be to use anchors to assert the start and the end of the string and use a positive lookahead to assert the length of the string to 10:
^(?=.10$)[A-Z]?(?:[a-z][A-Z])+[a-z]?$
Explanation
^
Start of the string(?=[a-zA-Z]10$)
Assert lenght of 10 characters a-z[A-Z]?
Match optional uppercase char(?:[a-z][A-Z])+
Match 1+ times a lowercase char followed by an uppercase char[a-z]?
Match optional lowercase char$
End of string
Regex demo
edited Mar 24 at 18:26
answered Mar 24 at 15:09
The fourth birdThe fourth bird
30.6k91631
30.6k91631
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%2f55324913%2freally-vague-regex-question-string-that-always-iterates-between-uppercase-and-l%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
How do you conclude that your latter attempt is wrong? What do you think is blurry about the question?
– tripleee
Mar 24 at 15:09