 In the world of Rejects, anchors and boundaries are the most important concept to understand. They are simple but yet you cannot ignore it. Anchors are a way to assert where we expect boundaries in the string which we are examining. Though boundary assertions are not much important but when combined with other reject syntaxes they can be very powerful. Since meta-characters are a way to tell rejects that, hey, please start a match from here but do not cross this limit. Say here I have defined one statement, so over here boundaries can be the start of a string or the end of a string or it can be the start of a line or the end of a line or it can be a word boundary. But remember one thing, boundary assertions will not match characters, they just check for the boundary itself. So far we have been writing regular expressions that partially match pieces across all the text, sometimes this is not desirable. Did you remember this HL7 file name match demo from the previous video? This file name is consisting of more than 3 characters but still rejects matches with it. And to avoid this I would need to get more specific with my expression and say only match things that start with this particular set and that is exactly when you would want to use anchors and boundaries. Anchors have a special meaning in regular expressions, they don't match any characters. What they do is ensure that matches a position before, after or between characters. So there are two different types of anchors, a start of line anchor which is a carrot sign and an end of line anchor which is dollar sign. The carrot sign anchor matches the beginning of the string or a line, to find only the words that appears at the start of a line. You can include this anchor sign before the text to match in the regular expression. And using dollar sign anchor character, you can search for a text at the end of the string or at the end of a line and with this anchor the rest of the pattern must match immediately before a line fit character. Let us see one demo from our previous video where we match HL7 file name and how this anchor meta character help us to match a position before or after the characters. Alright, so if you remember this demo from the previous module where we wrote this regex to match the HL7 file which name start with the first three character followed by underscore and followed by six digit. Now notice here this last two file name it is still matches by this given regex even if it start with the six characters and ends with some other extension. So now if I add the carrot sign over here then did you see the difference? This file is removed now from the matching list and same way if I add the dollar sign over here then the last file name is also removed from the matching list. So this is how we tell the regex that please start matching input from here and ends the matching over here. Now what about word boundaries? Let us understand that meta character concept. As we saw in the previous video that by using the start of a line and end of a line anchors we were able to match an exit files which we are expecting. But if what I was matching was not at the start of the line or at the end of the line. So in that case these anchors would not have helped at all and that is where word boundaries comes in. Word boundaries are another meta character in regular expression that matches by position rather than by character. So there are again two meta characters backslash B and capital backslash B which matches word boundaries and non-word boundaries respectively. So word boundaries are the point in a string between a word character and a non-word character. It can be at the beginning of a string if the first character is a word character or it can be at the end of a string if the last character is a word character. Non-word characters can be period or a dot or a space or a column or any other punctuation mark. Non-word boundaries are exactly the opposite. It points in a string between two adjacent characters of the same type either word or a non-word. Now let's take a look at the example of word boundaries. Alright so here I have defined one statement in the input text and say we want to find a specific word from this text. Say for example here I want to find a word out so if I write that word in the regex then it started matching the three words instead of what I want. Now let us define the word boundaries by using the backslash B meta character in the start and in the end like this B and in the end backslash B. So did you see the result changes and now it started matching the exact word which we are looking for. So this is how we can define the boundaries by using the backslash B meta character. Alright now let us move on to the next and last concept in regex which is grouping and sub-pattern.