Suppose I have search the string which give like the following result
anything1.knownKeyWord anything2.knownKeyWord anything3[1].knownKeyWord How I can write generic syntax for grep such it match all 3 string. I have done like this
^.*\w+\d[\[]?[0]?[\]]?\.knownKeyWord.*$ But I think for indexing eg [1] is not written in good way, how can I achieve so that even i replace [1] with [2342jdsjf], I don't have to change the syntax much.