# regular expression of the second last symbol is 1

A regular expression of the second last symbol is 1.

**Regular Expression ****(1+0)*(10+11)**

The set of strings where the second last symbol is 1. For example, in the case of string 100010 and 00100110010, the second last symbol is 1

## FA for the language of strings of second last symbol is 1.

**Rejectable strings (not part of the language)**

These strings must be rejected by our Regular expression.

- 3 strings of length 1 ={ 0, 1, no more strings}
- 3 strings of length 2 ={00, no more string}
- 3 strings of length 3 ={101, 100, 001, and many more similar possible strings }
- 3 strings of length 4 ={1001, 1101, 1000,0001, … and similar possible strings }
- 3 strings of length 7 ={1010001, 1011000,1001001, ….. and many more similar possible strings }
- 3 strings of length 10 ={1010000000, 1010000001, 10100000011….. and many more similar possible strings }
- 3 strings of length 15 ={101000000011100, 101000000101000, 1010000010000001….. and many more similar possible strings }
- 3 strings of length 20 = {10100000001010000000, 10100000011010000001, 1010000010010100000100….. and many more similar possible strings }
- 3 strings of length 25 = {1010000000101000001111100, 1010111110000111001101100, 0000111100000001111000000……. and many more similar possible strings }
- Much more similar possible

**Acceptable strings (part of the language)**

These strings must be accepted by our Regular expression.

- 3 strings of length 1 ={no string of length 1}
- 3 strings of length 2 ={11, 10 no more similar possible string of length 1}
- 3 strings of length 3 ={110, 111,o11 no more similar possible string of length 3}
- 3 strings of length 4 ={0010, 1111,0110,…… and many more similar possible strings}
- 3 strings of length 7 ={0110010, 0010110, 1100010,….. and many more similar possible strings }
- 3 strings of length 10 ={0001100010, 1100010110, 1100010110, 1110001010….. and many more similar possible strings }
- 3 strings of length 15 ={101000000011110, 101000000101010, 1010000010000011….. }
- 3 strings of length 20 = {10100000001010000010, 10100000011010000010, 1010000010010100000110….. }
- 3 strings of length 25 = {1010000000101000001111010, 1010111110000111001100110, 0000111100000001111000010…….}
- Much more similar possible

**Regular Expression ****(b+a)*(ba+bb)**

The set of strings where the second last symbol is b. For example in the case of string baaaba and aabaabbaaba the second last symbol is b.

**Rejectable strings (not part of the language)**

These strings must be rejected by our Regular expression.

- 3 strings of length 1 ={ a, b, no more strings}
- 3 strings of length 2 ={aa, no more string}
- 3 strings of length 3 ={bab, baa, aab, and many more similar possible strings }
- 3 strings of length 4 ={baab, bbab, baaa,aaab, … and similar possible strings }
- 3 strings of length 7 ={babaaab, babbaaa,baabaab, ….. and many more similar possible strings }
- 3 strings of length 10 ={babaaaaaaa, babaaaaaab, babaaaaaabb….. and many more similar possible strings }
- 3 strings of length 15 ={babaaaaaaabbbaa, babaaaaaababaaa, babaaaaabaaaaaab….. and many more similar possible strings }
- 3 strings of length 20 = {babaaaaaaababaaaaaaa, babaaaaaabbabaaaaaab, babaaaaabaababaaaaabaa….. and many more similar possible strings }
- 3 strings of length 25 = {babaaaaaaababaaaaabbbbbaa, bababbbbbaaaabbbaabbabbaa, aaaabbbbaaaaaaabbbbaaaaaa……. and many more similar possible strings }
- Many more similar possible

**Acceptable strings (part of the language)**

These strings must be accepted by our Regular expression.

- 3 strings of length 1 ={no string of length b}
- 3 strings of length 2 ={bb, ba no more similar possible string of length b}
- 3 strings of length 3 ={bba, bbb,obb no more similar possible string of length 3}
- 3 strings of length 4 ={aaba, bbbb,abba,…… and many more similar possible strings}
- 3 strings of length 7 ={abbaaba, aababba, bbaaaba,….. and many more similar possible strings }
- 3 strings of length 10 ={aaabbaaaba, bbaaababba, bbaaababba, bbbaaababa….. and many more similar possible strings }
- 3 strings of length 15 ={babaaaaaaabbbba, babaaaaaabababa, babaaaaabaaaaabb….. }
- 3 strings of length 20 = {babaaaaaaababaaaaaba, babaaaaaabbabaaaaaba, babaaaaabaababaaaaabba….. }
- 3 strings of length 25 = {babaaaaaaababaaaaabbbbaba, bababbbbbaaaabbbaabbaabba, aaaabbbbaaaaaaabbbbaaaaba…….}
- Many more similar possible

## More Examples of Regular Expression

- Regular Expression for no 0 or many triples of 0’s and many 1 in the strings.
- RegExp for strings of one or many 11 or no 11.
- A regular expression for ending with abb
- A regular expression for all strings having 010 or 101.
- Regular expression for Even Length Strings defined over {a,b}
- Regular Expression for strings having at least one double 0 or double 1.
- Regular Expression of starting with 0 and having multiple even 1’s or no 1.
- Regular Expression for an odd number of 0’s or an odd number of 1’s in the strings.
- Regular Expression for having strings of multiple double 1’s or null.
- Regular Expression (RE) for starting with 0 and ending with 1.
- RE for ending with b and having zero or multiple sets of aa and bb.
- A regular expression of the second last symbol is 1.
- RE for starting with 1 having zero or multiple even 1’s.
- Regular Expression for multiple a’s and multiple b’s.
- RE for exactly single 1 many 0’s |exactly single a many b.
- A regular expression for strings starting with aa and ending with ba.
- A regular expression for the language of all consecutive even length a’s.
- A regular expression for the language of all odd-length strings
- A regular expression for the language of all even length strings but ends with aa.
- A regular expression for the language of an odd number of 1s.
- A regular expression for the language of even length strings starting with a and ending with b in theory of automata.
- A regular expression for the language of all even length strings but starts with a.
- A Regular Expression for the Language of all strings with an even number of 0’s or even number of 1’s.
- A regular expression for the language of all those strings end with abb.
- A regular expression for string having must 010 or 101.
- Regular expression of strings begin with 110

Regular expression of strings begin and end with 110

Regular expression of strings containing exactly three consecutive 1’s. - A Regular Expression of all strings divisible by 4.
- A Regular Expression Strings that does not contain substring 110.

## Tutorial: Regular Expression

A detailed tutorial of the regular expression is here in the link of regular expression tutorial. This page contains the practice questions of regular expressions with solutions.

**Tutorial covering the topics**

- Give a regular expression.
- Describe the strings of the regular expression.
- write a regular expression.
- create all strings from regular expression.
- Generate all strings from regular expression.
- Extract all strings from regular expression.
- Find all strings from regular expression.
- Examples of regular expression.