What is the difference between the following regular expressions? (a U b)* and (ab)*
Difference between union and concatenation ? which of the above regex accepts strings in which 'a' is always before 'b' ?
Please clarify.. Thanks in advance.
What is the difference between the following regular expressions? (a U b)* and (ab)*
Difference between union and concatenation ? which of the above regex accepts strings in which 'a' is always before 'b' ?
Please clarify.. Thanks in advance.
Copyright © 2021 Jogjafile Inc.
(ab)* means zero of more instances of the sequence ab. For example,
Consider a* and b*:
Concatenation is to add one set onto another. a* concat b* would be concatenating the sequence resulting from a* with the one resulting from b*, so:
Union is to combine two sets and results in the distinct results.So, a* U b* would be the regular expressions of zero or more instances of a and zero or more instances of b: