![]() ![]() Second, it is efficient: when you tell the engine that you want to find a compex pattern at a given location, it doesn't have to spend time trying to find that pattern at many other locations. First, it is expressive: it lets you specify that you want to match digits at the end of a line, but not anywhere else. This type of assertion is useful for several reasons. Anchors assert that the engine's current position in the string matches a well-determined location: for instance, the beginning of the string, or the end of a line. Anchors belong to the family of regex tokens that don't match any characters, but that assert something about the string or the matching process.
0 Comments
Leave a Reply. |