Q:

How to search for a pattern using grep?

I want to search a file to check for patterns like this:
text1,text2,[1.2.3,3.4.5,6.7.8,etc] exist. The number of commas inside the square brackets is undefined. 
I tried the following command but it prints the commas after text1 and text2 which is not what I want. I'm looking only for finding commas inside the square brackets.
$ grep -E '[*,*]' myfile.txt

EDIT #1
Here's some sample input. Note that the commas inside brackets can be more or less than the number in the example (i.e. undefined number so I have to capture them with regex):
1.com,1.2.3.4,txt1,txt11,['1.2.3.4', '5.6.7.8']
2.com,3.4.5.6,txt2,txt21,['5.6.6.6']
3.com,5.5.5.5,txt3,txt31,['1.1.1.1', '2.2.2.2', '3.3.3.3']

A:

To match lines that contain at least one comma inside square brackets, you can use 
grep '\[.*,.*\]'

Ex.
$ grep '\[.*,.*\]' file
1.com,1.2.3.4,txt1,txt11,['1.2.3.4', '5.6.7.8']
3.com,5.5.5.5,txt3,txt31,['1.1.1.1', '2.2.2.2', '3.3.3.3']

The square brackets need to be escaped because they have special meaning in regular expression syntax. Notice I didn't need to use -E with grep, the basic pattern matching facilities of grep were sufficient.
NOTE: grep will typically display the matches as colored so you can tell what's actually getting matched by any patterns you use:
   

