Hi Ruchi,
These are two questions.
1) You are saying green and blue are optional by inserting the question mark ? which is acting as a quantifier meaning zero or one time. Then you mark a plus which means 1 or more times. The effect is the same as writing * qhich signifies any number of times (zero or more).
Then you write .+ which means one or more times any character. The end result would be your are matching any string consisting of one or more characters. From the regex I do not know what you are trying to match, but semantically your regexd is exactly equal to just writing .+ with the difference that if the string starts with green or blue you now have it in a capturing group.
2)
You are matching a time that is surrounded by either single or double or no quotes, followed by a word that starts with a capital and is surrounded by either single or double or no quotes. After the komma it will match anything (because of .*) which is why after the time and word anything is matched, such as ,"World"
The two backreferences \1 and \2 makes sure the quotes are matched by the same time, so a start double quote is not matched by an ending double quote.
Op dinsdag 26 mei 2015 18:38:34 UTC+2 schreef Ruchi Saini: