What is the regular expression? [closed]Regular expression arithmeticsNegate regular expressionBasic regular expressions problemRegular expression of: $ w in Sigma^* : w text does not contain the substring 110 $.Equivalence of two regular expressionChecking some Regular Expression problemsFind regular expression for a given languageRegular expression of a languageof two letters that must alternate?Formally expressing regular expressionThree regular expressions

Modeling an IP Address

Could an aircraft fly or hover using only jets of compressed air?

How to move a thin line with the black arrow in Illustrator?

Revoked SSL certificate

Cross compiling for RPi - error while loading shared libraries

Do infinite dimensional systems make sense?

Was any UN Security Council vote triple-vetoed?

A case of the sniffles

Is it possible to do 50 km distance without any previous training?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How can bays and straits be determined in a procedurally generated map?

"You are your self first supporter", a more proper way to say it

What does the "remote control" for a QF-4 look like?

Can a monk's single staff be considered dual wielded, as per the Dual Wielder feat?

How does one intimidate enemies without having the capacity for violence?

Uncaught TypeError: 'set' on proxy: trap returned falsish for property Name

Codimension of non-flat locus

Is it inappropriate for a student to attend their mentor's dissertation defense?

How is it possible to have an ability score that is less than 3?

Why can't I see bouncing of switch on oscilloscope screen?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

Why are electrically insulating heatsinks so rare? Is it just cost?

Is it possible to run Internet Explorer on OS X El Capitan?

Decision tree nodes overlapping with Tikz



What is the regular expression? [closed]


Regular expression arithmeticsNegate regular expressionBasic regular expressions problemRegular expression of: $ w in Sigma^* : w text does not contain the substring 110 $.Equivalence of two regular expressionChecking some Regular Expression problemsFind regular expression for a given languageRegular expression of a languageof two letters that must alternate?Formally expressing regular expressionThree regular expressions













0












$begingroup$


Let $Sigma =1,0$.



What is the regular expression that contains at most one occurrence of substring "$11$"?










share|cite|improve this question











$endgroup$



closed as off-topic by Shailesh, Paul Frost, Thomas Shelby, José Carlos Santos, Adrian Keister Mar 29 at 21:39


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Shailesh, Paul Frost, Thomas Shelby, José Carlos Santos, Adrian Keister
If this question can be reworded to fit the rules in the help center, please edit the question.











  • 2




    $begingroup$
    Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be put on hold. To prevent that, please edit the question. This will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers.
    $endgroup$
    – José Carlos Santos
    Mar 29 at 9:55






  • 1




    $begingroup$
    What have you tried so far?
    $endgroup$
    – frabala
    Mar 29 at 9:57











  • $begingroup$
    I have tried this: 1*0*(1+11+ε)0*1* but I think it's not true!
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:04















0












$begingroup$


Let $Sigma =1,0$.



What is the regular expression that contains at most one occurrence of substring "$11$"?










share|cite|improve this question











$endgroup$



closed as off-topic by Shailesh, Paul Frost, Thomas Shelby, José Carlos Santos, Adrian Keister Mar 29 at 21:39


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Shailesh, Paul Frost, Thomas Shelby, José Carlos Santos, Adrian Keister
If this question can be reworded to fit the rules in the help center, please edit the question.











  • 2




    $begingroup$
    Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be put on hold. To prevent that, please edit the question. This will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers.
    $endgroup$
    – José Carlos Santos
    Mar 29 at 9:55






  • 1




    $begingroup$
    What have you tried so far?
    $endgroup$
    – frabala
    Mar 29 at 9:57











  • $begingroup$
    I have tried this: 1*0*(1+11+ε)0*1* but I think it's not true!
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:04













0












0








0





$begingroup$


Let $Sigma =1,0$.



What is the regular expression that contains at most one occurrence of substring "$11$"?










share|cite|improve this question











$endgroup$




Let $Sigma =1,0$.



What is the regular expression that contains at most one occurrence of substring "$11$"?







automata regular-language regular-expressions






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 29 at 11:38









frabala

2,5341122




2,5341122










asked Mar 29 at 9:51









Mahdi NaderiMahdi Naderi

1




1




closed as off-topic by Shailesh, Paul Frost, Thomas Shelby, José Carlos Santos, Adrian Keister Mar 29 at 21:39


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Shailesh, Paul Frost, Thomas Shelby, José Carlos Santos, Adrian Keister
If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Shailesh, Paul Frost, Thomas Shelby, José Carlos Santos, Adrian Keister Mar 29 at 21:39


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Shailesh, Paul Frost, Thomas Shelby, José Carlos Santos, Adrian Keister
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 2




    $begingroup$
    Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be put on hold. To prevent that, please edit the question. This will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers.
    $endgroup$
    – José Carlos Santos
    Mar 29 at 9:55






  • 1




    $begingroup$
    What have you tried so far?
    $endgroup$
    – frabala
    Mar 29 at 9:57











  • $begingroup$
    I have tried this: 1*0*(1+11+ε)0*1* but I think it's not true!
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:04












  • 2




    $begingroup$
    Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be put on hold. To prevent that, please edit the question. This will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers.
    $endgroup$
    – José Carlos Santos
    Mar 29 at 9:55






  • 1




    $begingroup$
    What have you tried so far?
    $endgroup$
    – frabala
    Mar 29 at 9:57











  • $begingroup$
    I have tried this: 1*0*(1+11+ε)0*1* but I think it's not true!
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:04







2




2




$begingroup$
Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be put on hold. To prevent that, please edit the question. This will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers.
$endgroup$
– José Carlos Santos
Mar 29 at 9:55




$begingroup$
Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be put on hold. To prevent that, please edit the question. This will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers.
$endgroup$
– José Carlos Santos
Mar 29 at 9:55




1




1




$begingroup$
What have you tried so far?
$endgroup$
– frabala
Mar 29 at 9:57





$begingroup$
What have you tried so far?
$endgroup$
– frabala
Mar 29 at 9:57













$begingroup$
I have tried this: 1*0*(1+11+ε)0*1* but I think it's not true!
$endgroup$
– Mahdi Naderi
Mar 29 at 17:04




$begingroup$
I have tried this: 1*0*(1+11+ε)0*1* but I think it's not true!
$endgroup$
– Mahdi Naderi
Mar 29 at 17:04










1 Answer
1






active

oldest

votes


















0












$begingroup$

Regex:



^((?!11).)*(11)?(?!1)((?!11).)*$


Python:



import re

def check(s):
if re.match(r'^((?!11).)*(11)?(?!1)((?!11).)*$', s):
print('True')
else:
print('False')

check('1010101') # TRUE

check('10101101') # TRUE

check('10110101') # TRUE

check('101101011') # FALSE

check('1011101010101') # FALSE

check('1010100000101011') # TRUE

check('10101000001010111') # FALSE

check('1010100111110010101') # FALSE





share|cite|improve this answer









$endgroup$












  • $begingroup$
    And how do you write ^((?!11).)*(11)?(?!1)((?!11).)*$ in mathematics format?
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:26

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0












$begingroup$

Regex:



^((?!11).)*(11)?(?!1)((?!11).)*$


Python:



import re

def check(s):
if re.match(r'^((?!11).)*(11)?(?!1)((?!11).)*$', s):
print('True')
else:
print('False')

check('1010101') # TRUE

check('10101101') # TRUE

check('10110101') # TRUE

check('101101011') # FALSE

check('1011101010101') # FALSE

check('1010100000101011') # TRUE

check('10101000001010111') # FALSE

check('1010100111110010101') # FALSE





share|cite|improve this answer









$endgroup$












  • $begingroup$
    And how do you write ^((?!11).)*(11)?(?!1)((?!11).)*$ in mathematics format?
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:26















0












$begingroup$

Regex:



^((?!11).)*(11)?(?!1)((?!11).)*$


Python:



import re

def check(s):
if re.match(r'^((?!11).)*(11)?(?!1)((?!11).)*$', s):
print('True')
else:
print('False')

check('1010101') # TRUE

check('10101101') # TRUE

check('10110101') # TRUE

check('101101011') # FALSE

check('1011101010101') # FALSE

check('1010100000101011') # TRUE

check('10101000001010111') # FALSE

check('1010100111110010101') # FALSE





share|cite|improve this answer









$endgroup$












  • $begingroup$
    And how do you write ^((?!11).)*(11)?(?!1)((?!11).)*$ in mathematics format?
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:26













0












0








0





$begingroup$

Regex:



^((?!11).)*(11)?(?!1)((?!11).)*$


Python:



import re

def check(s):
if re.match(r'^((?!11).)*(11)?(?!1)((?!11).)*$', s):
print('True')
else:
print('False')

check('1010101') # TRUE

check('10101101') # TRUE

check('10110101') # TRUE

check('101101011') # FALSE

check('1011101010101') # FALSE

check('1010100000101011') # TRUE

check('10101000001010111') # FALSE

check('1010100111110010101') # FALSE





share|cite|improve this answer









$endgroup$



Regex:



^((?!11).)*(11)?(?!1)((?!11).)*$


Python:



import re

def check(s):
if re.match(r'^((?!11).)*(11)?(?!1)((?!11).)*$', s):
print('True')
else:
print('False')

check('1010101') # TRUE

check('10101101') # TRUE

check('10110101') # TRUE

check('101101011') # FALSE

check('1011101010101') # FALSE

check('1010100000101011') # TRUE

check('10101000001010111') # FALSE

check('1010100111110010101') # FALSE






share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Mar 29 at 11:29









OldboyOldboy

9,30111138




9,30111138











  • $begingroup$
    And how do you write ^((?!11).)*(11)?(?!1)((?!11).)*$ in mathematics format?
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:26
















  • $begingroup$
    And how do you write ^((?!11).)*(11)?(?!1)((?!11).)*$ in mathematics format?
    $endgroup$
    – Mahdi Naderi
    Mar 29 at 17:26















$begingroup$
And how do you write ^((?!11).)*(11)?(?!1)((?!11).)*$ in mathematics format?
$endgroup$
– Mahdi Naderi
Mar 29 at 17:26




$begingroup$
And how do you write ^((?!11).)*(11)?(?!1)((?!11).)*$ in mathematics format?
$endgroup$
– Mahdi Naderi
Mar 29 at 17:26