# Prove a language is regular - Regular language of 0's and 1's [duplicate]

I'm new to regular languages and I've been struggling to solve one for a while. The question is:

If there exists a regular language L1 which has an alphabet {0,1}, prove that L2 is also a regular language if L2 comprises of strings x where x = ABC where B is an element in L1 and A and C are strings comprised of 0's and 1's.

I intuitively believe that since we know L1 is a regular language, we know that any string of 0's and 1's is a regular language. Hence, L2 should be a regular language as it is comprised of only 0's and 1's (by definition). Apparently, this is the wrong approach. Can someone assist me in solving this problem?

Thank you!

EDIT:

I realize my explanation was off. We know that L1 is a regular language composed of strings of "0" and "1", for example, "000111", "010101", could exist as elements in this language. If there are finite elements inside the language, then clearly by mutlipying it by two constant strings, we will get a finite output (hence regular). However, if it is not finite, that means it must have a regular expression that describes the language. Thus, any concatenation with two similar strings will still be that same regular expression with two constants added on top of it (hence still represented by a reg ex and thus a regular language).

Where is my logic flawed?

Thank you!

## marked as duplicate by David Richerby, Evil, Juho, Gilles♦Sep 24 '16 at 21:22

• To give more clarification on @DavidRicherby 's point, consider that if we are saying that "any string of 0's and 1's is a regular language", we are saying that the language $L=0^n1^n$ is also regular, which it is not. – px06 Sep 15 '16 at 8:50
Hint. The language $L_2$ is the concatenation of the languages $U$ and $L_1$, namely $L_2 = U\circ L_1\circ U$, where $U$ is the set of all strings over $\{0,1\}$.
• Is $U$ a regular language?