Veena, Freddy's regular expression is fairly simple as these things go, so I'll have a go at explaining it for you.
which of course without the Java string escaping is
which makes it a bit clearer. We know that ., *, ( and ) are all metacharacters in regular expressions. The =, " and " will all match literally.
So, starting at the beginning:
. means 'match any character'. Followed by a *, it becomes 'match zero or more of anything', as many times as possible.
Then the = means match the character '='.
After this we have a literal '"' to match.
( opens a capturing group, which contains again .* to match zero or more of any character. ) closes the group.
Finally, another '"' matches the quotation mark at the end of the string.
If you wrote the regular expression out in English you might get this:
Match zero or more characters as many times as possible, followed by an equals sign and a double quote, then match zero or more characters as many times as possible, remembering them in a capture group, followed by a double quote.
The 'as many times as possible' is important because * is a 'greedy' modifier and will grab the longest string which still allows the rest of the regular expression to match. For example, this would match:
and so would
In the latter case, the captured group (the .* in parens) would be 'Something"Something', and the first .* would have matched 's.name=s.name'.
I hope that's helpful. Regular expressions are something you just have to learn, and the best way to do that is by writing them. I did it by doing a lot of coding in Perl, where you tend to use regular expressions with great regularity, but there's no point learning Perl just to learn regular expressions