# Explaining regular expressions

folks. My question is about explaining the each step of regular expressions. The task is to find the regular expression that contains 101 as a substring. I already know that the regular expression for this is

$$(0 + 1)^*101(0 + 1)^*.$$

The question is that how we should show each step for explaining the regular expressions.

• The regular expression 101 also contains 101 as a substring. I suspect you are looking for a regular expression whose language consists of all strings containing 101 as a substring. Apr 11 '17 at 6:17
• Sorry, but what you mean by that? I already explained what I should do. Apr 11 '17 at 6:38
• But you didn't explain it correctly. Also, what is your question to us? Be specific. Where do you get stuck? Apr 11 '17 at 19:45
• That was from my homework, actually. As far as know to show that regular expression accepts strings, we have to show some sample strings that are in that regular expression. What instructor wants from us is to mention how we came to the final result of that regular expression. That's the thing I really didn't understand. Apr 12 '17 at 17:23

• You can use general properties of how regular expressions describe languages. For example, for any two regular expressions $X$ and $Y$, $L(XY) = L(X)L(Y)$. You can use this in your proof. Apr 11 '17 at 19:47