SlideShare a Scribd company logo
Write a Regular Expression, requirements:
1. They contain letters, digits, and punctuation symbols
2. They must contain at least a letter and a number, and at least one but at most two punctuation
symbols
3. They cannot start with a punctuation symbol
Using exclusively the regular expresssion operators epsilon(empty), * (zero or more copies), and
+ (concatenation), write a regular expression denoting the set of all passwords that satisfy these
requirements. For brevity, use: L, D, and P to denote Letter, Digit, and Punctuation, respectively.
My answer: ( LD ) ( P + PP ) ( L + D )* + ( DL ) ( P + PP ) ( L + D )* ... but I don't think it is
correct.
Solution
So the required expression can be written as follows:
^[ LDP ]* + [ LD ] [ LDP ]*

More Related Content

More from arjunenterprises1978

Ellen died with the following property house in joint tenancy wi.pdf
Ellen died with the following property house in joint tenancy wi.pdfEllen died with the following property house in joint tenancy wi.pdf
Ellen died with the following property house in joint tenancy wi.pdf
arjunenterprises1978
 
essages in the process of communication. Active listening is very im.pdf
essages in the process of communication. Active listening is very im.pdfessages in the process of communication. Active listening is very im.pdf
essages in the process of communication. Active listening is very im.pdf
arjunenterprises1978
 
Ed Norton, a city maintenance worker, is inspecting a sewer line. To.pdf
Ed Norton, a city maintenance worker, is inspecting a sewer line. To.pdfEd Norton, a city maintenance worker, is inspecting a sewer line. To.pdf
Ed Norton, a city maintenance worker, is inspecting a sewer line. To.pdf
arjunenterprises1978
 
Can -1^ (14) be expressed in terms of iSolutionTo express (-1.pdf
Can -1^ (14) be expressed in terms of iSolutionTo express (-1.pdfCan -1^ (14) be expressed in terms of iSolutionTo express (-1.pdf
Can -1^ (14) be expressed in terms of iSolutionTo express (-1.pdf
arjunenterprises1978
 
digestive disorders of the GI tractSolutionThe two common dige.pdf
digestive disorders of the GI tractSolutionThe two common dige.pdfdigestive disorders of the GI tractSolutionThe two common dige.pdf
digestive disorders of the GI tractSolutionThe two common dige.pdf
arjunenterprises1978
 
Define ionophore and describe how the compound A23187 affects intrac.pdf
Define ionophore and describe how the compound A23187 affects intrac.pdfDefine ionophore and describe how the compound A23187 affects intrac.pdf
Define ionophore and describe how the compound A23187 affects intrac.pdf
arjunenterprises1978
 
Describe how a prioritized set of system requirements is developed i.pdf
Describe how a prioritized set of system requirements is developed i.pdfDescribe how a prioritized set of system requirements is developed i.pdf
Describe how a prioritized set of system requirements is developed i.pdf
arjunenterprises1978
 
Consider the equation 1 2x = sin x. (a) Use the Intermediate Val.pdf
Consider the equation 1  2x = sin x. (a) Use the Intermediate Val.pdfConsider the equation 1  2x = sin x. (a) Use the Intermediate Val.pdf
Consider the equation 1 2x = sin x. (a) Use the Intermediate Val.pdf
arjunenterprises1978
 
A binary encoded signal has a bit-rate of Rb = 28 kbps. An Alternate .pdf
A binary encoded signal has a bit-rate of Rb = 28 kbps. An Alternate .pdfA binary encoded signal has a bit-rate of Rb = 28 kbps. An Alternate .pdf
A binary encoded signal has a bit-rate of Rb = 28 kbps. An Alternate .pdf
arjunenterprises1978
 
15.) What kind of reaction occurs between Sudan III and hydrophobic .pdf
15.) What kind of reaction occurs between Sudan III and hydrophobic .pdf15.) What kind of reaction occurs between Sudan III and hydrophobic .pdf
15.) What kind of reaction occurs between Sudan III and hydrophobic .pdf
arjunenterprises1978
 
1.) a.What was the original definition of a virus before it could be.pdf
1.) a.What was the original definition of a virus before it could be.pdf1.) a.What was the original definition of a virus before it could be.pdf
1.) a.What was the original definition of a virus before it could be.pdf
arjunenterprises1978
 
1.Is the following discrete or continuous, number of brothers a pers.pdf
1.Is the following discrete or continuous, number of brothers a pers.pdf1.Is the following discrete or continuous, number of brothers a pers.pdf
1.Is the following discrete or continuous, number of brothers a pers.pdf
arjunenterprises1978
 
1. What two types of ICMP messages are received at the sending hos.pdf
1. What two types of ICMP messages are received at the sending hos.pdf1. What two types of ICMP messages are received at the sending hos.pdf
1. What two types of ICMP messages are received at the sending hos.pdf
arjunenterprises1978
 
C++Write a method Node Nodereverse() which reverses a list..pdf
C++Write a method Node Nodereverse() which reverses a list..pdfC++Write a method Node Nodereverse() which reverses a list..pdf
C++Write a method Node Nodereverse() which reverses a list..pdf
arjunenterprises1978
 
Briefly describe the pathogenesis of typhoid fever when the bacteria.pdf
Briefly describe the pathogenesis of typhoid fever when the bacteria.pdfBriefly describe the pathogenesis of typhoid fever when the bacteria.pdf
Briefly describe the pathogenesis of typhoid fever when the bacteria.pdf
arjunenterprises1978
 
You are working In a lab with several different macromolecules from F.pdf
You are working In a lab with several different macromolecules from F.pdfYou are working In a lab with several different macromolecules from F.pdf
You are working In a lab with several different macromolecules from F.pdf
arjunenterprises1978
 
Write a program Grader that that will be used by a program driver to.pdf
Write a program Grader that that will be used by a program driver to.pdfWrite a program Grader that that will be used by a program driver to.pdf
Write a program Grader that that will be used by a program driver to.pdf
arjunenterprises1978
 
Why can Benedicts solution be used to distinguish between glucose .pdf
Why can Benedicts solution be used to distinguish between glucose .pdfWhy can Benedicts solution be used to distinguish between glucose .pdf
Why can Benedicts solution be used to distinguish between glucose .pdf
arjunenterprises1978
 
Which of the following is TRUE about alternation of generationsIt.pdf
Which of the following is TRUE about alternation of generationsIt.pdfWhich of the following is TRUE about alternation of generationsIt.pdf
Which of the following is TRUE about alternation of generationsIt.pdf
arjunenterprises1978
 
What do you feel is a good definition of culture What elements dete.pdf
What do you feel is a good definition of culture  What elements dete.pdfWhat do you feel is a good definition of culture  What elements dete.pdf
What do you feel is a good definition of culture What elements dete.pdf
arjunenterprises1978
 

More from arjunenterprises1978 (20)

Ellen died with the following property house in joint tenancy wi.pdf
Ellen died with the following property house in joint tenancy wi.pdfEllen died with the following property house in joint tenancy wi.pdf
Ellen died with the following property house in joint tenancy wi.pdf
 
essages in the process of communication. Active listening is very im.pdf
essages in the process of communication. Active listening is very im.pdfessages in the process of communication. Active listening is very im.pdf
essages in the process of communication. Active listening is very im.pdf
 
Ed Norton, a city maintenance worker, is inspecting a sewer line. To.pdf
Ed Norton, a city maintenance worker, is inspecting a sewer line. To.pdfEd Norton, a city maintenance worker, is inspecting a sewer line. To.pdf
Ed Norton, a city maintenance worker, is inspecting a sewer line. To.pdf
 
Can -1^ (14) be expressed in terms of iSolutionTo express (-1.pdf
Can -1^ (14) be expressed in terms of iSolutionTo express (-1.pdfCan -1^ (14) be expressed in terms of iSolutionTo express (-1.pdf
Can -1^ (14) be expressed in terms of iSolutionTo express (-1.pdf
 
digestive disorders of the GI tractSolutionThe two common dige.pdf
digestive disorders of the GI tractSolutionThe two common dige.pdfdigestive disorders of the GI tractSolutionThe two common dige.pdf
digestive disorders of the GI tractSolutionThe two common dige.pdf
 
Define ionophore and describe how the compound A23187 affects intrac.pdf
Define ionophore and describe how the compound A23187 affects intrac.pdfDefine ionophore and describe how the compound A23187 affects intrac.pdf
Define ionophore and describe how the compound A23187 affects intrac.pdf
 
Describe how a prioritized set of system requirements is developed i.pdf
Describe how a prioritized set of system requirements is developed i.pdfDescribe how a prioritized set of system requirements is developed i.pdf
Describe how a prioritized set of system requirements is developed i.pdf
 
Consider the equation 1 2x = sin x. (a) Use the Intermediate Val.pdf
Consider the equation 1  2x = sin x. (a) Use the Intermediate Val.pdfConsider the equation 1  2x = sin x. (a) Use the Intermediate Val.pdf
Consider the equation 1 2x = sin x. (a) Use the Intermediate Val.pdf
 
A binary encoded signal has a bit-rate of Rb = 28 kbps. An Alternate .pdf
A binary encoded signal has a bit-rate of Rb = 28 kbps. An Alternate .pdfA binary encoded signal has a bit-rate of Rb = 28 kbps. An Alternate .pdf
A binary encoded signal has a bit-rate of Rb = 28 kbps. An Alternate .pdf
 
15.) What kind of reaction occurs between Sudan III and hydrophobic .pdf
15.) What kind of reaction occurs between Sudan III and hydrophobic .pdf15.) What kind of reaction occurs between Sudan III and hydrophobic .pdf
15.) What kind of reaction occurs between Sudan III and hydrophobic .pdf
 
1.) a.What was the original definition of a virus before it could be.pdf
1.) a.What was the original definition of a virus before it could be.pdf1.) a.What was the original definition of a virus before it could be.pdf
1.) a.What was the original definition of a virus before it could be.pdf
 
1.Is the following discrete or continuous, number of brothers a pers.pdf
1.Is the following discrete or continuous, number of brothers a pers.pdf1.Is the following discrete or continuous, number of brothers a pers.pdf
1.Is the following discrete or continuous, number of brothers a pers.pdf
 
1. What two types of ICMP messages are received at the sending hos.pdf
1. What two types of ICMP messages are received at the sending hos.pdf1. What two types of ICMP messages are received at the sending hos.pdf
1. What two types of ICMP messages are received at the sending hos.pdf
 
C++Write a method Node Nodereverse() which reverses a list..pdf
C++Write a method Node Nodereverse() which reverses a list..pdfC++Write a method Node Nodereverse() which reverses a list..pdf
C++Write a method Node Nodereverse() which reverses a list..pdf
 
Briefly describe the pathogenesis of typhoid fever when the bacteria.pdf
Briefly describe the pathogenesis of typhoid fever when the bacteria.pdfBriefly describe the pathogenesis of typhoid fever when the bacteria.pdf
Briefly describe the pathogenesis of typhoid fever when the bacteria.pdf
 
You are working In a lab with several different macromolecules from F.pdf
You are working In a lab with several different macromolecules from F.pdfYou are working In a lab with several different macromolecules from F.pdf
You are working In a lab with several different macromolecules from F.pdf
 
Write a program Grader that that will be used by a program driver to.pdf
Write a program Grader that that will be used by a program driver to.pdfWrite a program Grader that that will be used by a program driver to.pdf
Write a program Grader that that will be used by a program driver to.pdf
 
Why can Benedicts solution be used to distinguish between glucose .pdf
Why can Benedicts solution be used to distinguish between glucose .pdfWhy can Benedicts solution be used to distinguish between glucose .pdf
Why can Benedicts solution be used to distinguish between glucose .pdf
 
Which of the following is TRUE about alternation of generationsIt.pdf
Which of the following is TRUE about alternation of generationsIt.pdfWhich of the following is TRUE about alternation of generationsIt.pdf
Which of the following is TRUE about alternation of generationsIt.pdf
 
What do you feel is a good definition of culture What elements dete.pdf
What do you feel is a good definition of culture  What elements dete.pdfWhat do you feel is a good definition of culture  What elements dete.pdf
What do you feel is a good definition of culture What elements dete.pdf
 

Recently uploaded

clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 

Recently uploaded (20)

clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 

Write a Regular Expression, requirements1. They contain letters, .pdf

  • 1. Write a Regular Expression, requirements: 1. They contain letters, digits, and punctuation symbols 2. They must contain at least a letter and a number, and at least one but at most two punctuation symbols 3. They cannot start with a punctuation symbol Using exclusively the regular expresssion operators epsilon(empty), * (zero or more copies), and + (concatenation), write a regular expression denoting the set of all passwords that satisfy these requirements. For brevity, use: L, D, and P to denote Letter, Digit, and Punctuation, respectively. My answer: ( LD ) ( P + PP ) ( L + D )* + ( DL ) ( P + PP ) ( L + D )* ... but I don't think it is correct. Solution So the required expression can be written as follows: ^[ LDP ]* + [ LD ] [ LDP ]*