Write a Regular Expression requirements 1 They contain lette

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 ]*

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 l

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site