 Sometimes you will want to group certain parts of your regular expression to either capture it or repeat it. So to accomplish this you will need to use something called a grouping operator. The grouping operators have multiple functions. They are used to group things together by placing part of a regular expression inside round bracket or parenthesis. You can group that part of the rejects together. This allows you to apply a quantifier to the entire group or to restrict alternation to the part of the rejects. And then that sub-patterns will then create what's called a capture group which stores the value of that sub-expression in a special variable. Rejects will treat a grouped sequences as a unit just like any other programming languages which treat a parenthesized expression as a unit. Now the second function of the grouping operator is to remember and capture the sub-matches. Match information is normally written as an array. Array index 0 will contain the complete match and the subsequent indexes will contain the sub-matches. Here one thing to note is when the sub-match is for a repeating group only the last successful match will be remembered. I will show this in the demo part. Now let's look at a regular expression to match an IP address as an example. I think no need to tell you that an IPv4 IP address always consists of four groups of numbers separated by literal dot and that numbers are always between 0 to 255. So let's build a regular expression to match an IPv4 address. Alright so here I have added some valid and invalid IP addresses in the input text as you know that backslash d is used to match the digit between 0 to 9. So in the rejects part let me add backslash d. Now here what I want is I want to match a digit at least one time but not more than three times. So here I need to use a repetition quantifier. So in repetition quantifier let me add 1,3 in curly brace followed by a literal dot. Now next either I can repeat it two times to match the next two numbers or I can group those in parenthesis like this. And then I want to repeat this preceding pattern that grouping exactly three times. So let me add the repetition quantifier like this and lastly we want to repeat the numeric pattern one last time but now without dot. So as you can see that our rejects is ready now. Matching an IP address is a good example of a tradeoff between rejects complexity and exetness. Now this rejects of course matching an IP addresses but what if I add this IP address? Did you see this is totally an invalid IP address but it still matches. So to restrict all four numbers in the IP address from 0 to 255 we need to use another rejects. So let us write it. So here first branch will match the number from 250 to 255 and the second will match 200 to 249 and the third branch will match anything between 0 to 199 followed by a literal dot. And now this entire pattern I want to be matched three times. So here we have to use grouping to use a repetition quantifier against a complete group like this. And now the same numeric pattern we need to repeat it one last time over here but this time without dot. So yes now it matches the valid IP address from the given input string. So here we have a working rejects and a basic understanding of how to use grouping in the rejects. And with this it's the end of module 2 and in this module we had learned how to use quantifiers in rejects and how they can be useful. And then we had learned how to use shortcuts to show the rejects expression. And then we had learned how to use anchors and boundaries. And in the last we learned how to do grouping and matches sub pattern in regular expression. Now in the next module we will see some practical use cases of regular expression. So stay tuned.