**Regular Expression | Regular Definition**

Again Freestudy9 Is come with new post related to Regular Expression. After that, we had tried to make this topic very easy with some example. Additionally, we had given another part of it. so it will help you.

**Regular Expression**

1) 0 or 1

- 0+1

2) 0 or 11 or 111

- 0+11+111

3) Regular expression over 1={a,b,c}that represent all string of length

- (a+b +c) ( a+b+c) ( a+b+c)

4) String having zero or more a.

- a*

5) String having one or more a.

_{a}+

6) All binary string.

- (0+1)*

7) 0 or more occurrence of either a or b or both

- (a+b)*

8) 1 or more occurrence of either a or b or both

- (a+b)
^{+}

9) Binary no. end with 0

- (0+1)*0

10) Binary no. end with 1

- (0+1)*1

11) Binary no. starts and end with 1.

- 1(0+1) *1

12) The string starts and ends with same character.

0 (0+1)*0 or a(a+b)*a

1(0+1) *1 b(a+b)*b

13) All string of a and b starting with a

- a(a/b)*

14) String of 0 and 1 end with 00.

- (0+1) *00

15) String end with abb.

- (a+b)*abb

16) String start with 1 and end with 0.

- 1( 0+1)*0

## You May Also Like : Regular Expression

17) All binary string with at least 3 characters and 3rd character should be zero.

- (0+1) (0+1)0(0+1)*

18) Language which consist of exactly two b’s over the set 1.{a,13}

- a*ba*ba*

**19) {a,b} **such that 3rd character from right end of the string is always a.

- (a+b)*a(a+b)(a+b)

20) Any no. of a followed by any no. of b followed by any no. of c.

- a*b*c*

21) It should contain at least 3 one.

- ( 0+1)*1(0+ 1)*1(0 +1)*1(0 +1)*

22) String should contain exactly Two l’s

- 0*10*10*

23) Length should be at least be 1 and at most 3.

- (0+1 )+ ( 0+1) (0 +1) + ( 0+1) ( 0+1 ) (0+1)

24) of zero should be multiple of 3

- (1*01*01*01*)*+1*

25) {a,b,c} where a are multiple of 3.

- ((b+c)*a (b+c)*a (b+c)*a (b+c)*)*

26) Even no. of 0.

- (1*01*01*)*

27) Odd no. of 1.

- 0*(10*10*)*10*

28) String should have odd length.

- ( 0 +1)((0+ 1)( 0+1))*

29) String should have even length.

- ((0+ 1)(0+1))*

30) String start with 0 and has odd length.

- 0((0+1)(0+1))*

31) String start with 1 and has even length.

- 1( 0+1)( (0 +1) (0+ 1)) *

32) Even no of 1

- (0*10*10*)*

33) String of length 6 or less

- (0+1-0)
^{6}

34) String ending with 1 and not contain 00.

- (1+01)’

35) All string begins or ends with 00 or 11.

- (00+11)(0+1)*+(0+1)*(00+11)

36) All string not contains the substring 00.

- (1+01)* (A+0)

37) Language of all string containing both 11 and 00 as substring.

- ((0+1)*00(0+1)*11(0+1)*)+ ((0+1)*11(0+1)*00(0+1)*)

38) Language of C identifier.

- (_+L)(_+L+D)*

### Regular Definition: Regular Expression

- A regular definition gives names to certain regular expressions and uses those names in other regular expressions.
- Here is a regular definition of the set of Pascal identifiers that is defined as the set of strings of letters and digits beginning with a letter.

letter4A113

digit 4 0 1 1 12 I … 1 9

id 4 letter (letter I digit)*

- The regular expression it is the pattern for the identifier token and defines letter and digit. Where letter is a regular expression for the set of all upper-case and lower case letters in the alphabet and digit is the regular expression for the set of all decimal digits.

**Related Search**

Compiler Design, The linker, Pass of Compiler, Free Study.

## Leave a Reply