Example : th(e|is|at) will match words - the, this and that.īackreference: allows a previously matched sub-expression(expression captured or enclosed within circular brackets ) to be identified subsequently in the same regular expression.
Matches any one element separated by the vertical bar (|) character. This expression will match any patternĬontaining uppercase letter followed by any character. Example : (\w+) contains two different elements of the regularĮxpression combined together. Example : \d+\d+ will match patterns like "2+2"Ī set of different symbols of a regular expression can be grouped together to act as a single unit and behave as a block, for this, you need to wrap the regular expression in the parenthesis( ). This will tell the computer to treat the following character as a search character and consider it for matching pattern. If you want to match for the actual ‘+’, ‘.’ etc characters, add a backslash( \ ) before that character. Example : will match any character from a to z or A to Z. – Character range: Matches any single character in the range from first to last. Example : will match any character except a,b,c. – Negation: Matches any single character that is not in set_of_characters. Example : will match characters a,b and c in any string. – Matches any single character in set_of_characters. b : matches any word boundary (this would include spaces, dashes, commas, semi-colons, etc) w : matches any word character (basically alpha-numeric) S : matches any non-whitespace characters s : matches any whitespace characters such as space and tab It is used to match the most basic element of a language like a letter, a digit, space, a symbol etc. Example : $ will match with patterns like "-333" in "-901-333".Ī character class matches any one of a set of characters. It tells the computer to repeat the preceding character (or set of characters) for as many times as the value inside this bracket. Example : The regular expression ab+c will give abc, abbc, It tells the computer to repeat the preceding character (or set of characters) for atleast one or more times(upto infinite). Example : The regular expression ab*c will give ac, abc, abbc,
It tells the computer to match the preceding character (or set of characters) for 0 or more times (upto infinite). These symbols act as repeaters and tell the computer that the preceding character is to be used for more than just one time. vector::push_back() and vector::pop_back() in C++ STL.Overview of Data Structures | Set 1 (Linear Data Structures).Construct Tree from given Inorder and Preorder traversals.Print Postorder traversal from given Inorder and Preorder traversals.Inorder Tree Traversal without recursion and without stack!.Inorder Tree Traversal without Recursion.Tree Traversals (Inorder, Preorder and Postorder).Breadth First Search or BFS for a Graph.
Unique paths covering every non-obstacle block exactly once in a grid.Print all possible paths from top left to bottom right of a mXn matrix.Count all possible paths from top left to bottom right of a mXn matrix.Count number of ways to reach destination in a Maze.The Knight’s tour problem | Backtracking-1.Warnsdorff’s algorithm for Knight’s tour problem.Printing all solutions in N-Queen Problem.Top 10 algorithms in Interview Questions.A Step by Step Guide for Placement Preparation | Set 2.A Step by Step Guide for Placement Preparation | Set 1.ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.