432 views
0 votes
0 votes
Can regular lang have '-' symbol in them?

for example a* - b* is this a valid reg expression

if it is then what does it imply

1 Answer

Best answer
1 votes
1 votes

In regular expressions , the valid operators are :

() [ Parantheses ]  , '.' [ Concatenation ] , '+'  [ Union or choice ] ,  '*"  [  Kleene's Closure ] , '+' [Positive Closure]

Hence  a* - b* is not a valid regular expression.

However the minus operator can be used to denote difference of any two languages i.e.  L1 - L2 is valid suggesting that the strings which are in L1 but not in L2..

Hence L1 - L2 is valid irrespective of language class of L1 and L2.. 

selected by

Related questions

0 votes
0 votes
1 answer
2
A_i_$_h asked Sep 24, 2017
928 views
Regular expression area) Type 0 languageb) Type 1 languagec) Type 2 languaged) Type 3 language
0 votes
0 votes
1 answer
3
mehul vaidya asked Sep 3, 2018
527 views
To find intersection of this two : If i proceed like thisregular ∩ CFG CFG ∩ CFG as regular lang is also CFGbut CFG is not closed under intersectionhence answer ma...