Overview Golang regex package regexp uses the re2 engine which doesn’t support backreferences. You can check the same here https://github.com/google/re2/wiki/Syntax It does mention that it doesn’t support backreferences. However, there is another…
Tag: go
Golang Regex: Understanding dot ‘.’ character
Overview Dot ‘.’ character is one of the most commonly used metacharacters in the regular expression. It is used to match any character. It can also match a new line if a…
Golang Regex: Case insensitive regular expression matching in Go (Golang)
Overview The default behavior for regular expression matching in golang is case sensitive. But the default behavior can be changed by adding a set of flags to the beginning of the regular…
Delete a kth node from back in a Singly Linked List in Go (Golang)
Overview Delete a kth node from the back in a Singly Linked List Input linked list: Node to be removed is 3rd from the back, then Output linked list: Program Output Explanation…
Golang Regex: Match prefix or suffix of a string
Overview Golang regex contains two anchor characters that can be used to match the prefix and suffix of a string given a regular expression. These two characters are Caret Character ‘^’ –…
Alternation (OR) of regexes in Go (Golang)
Overview It is similar to OR operation. Join two regexes by using the | operator. If there are two regexes r1 and r2, then alternation is represented as below It will either…
Understanding Fprintln function in Go (Golang)
Overview Fprintln is defined in the fmt package and is used to format a string using the default format specifier and write it to io.Writer instance passed to it. It also adds…
Check if a linked list is circular in Go (Golang)
Overview Check if a linked list is circular. A linked list is circular is all nodes are connected in the form of a cylce. Program In the below program, we first create…
Convert singly linked list into a circular linked list using Go (Golang)
Overview Convert singly linked list into a circular linked list using Golang Input singly linked list: Output list that should be a circular linked list: Program There are two important methods in…
Convert singly linked list into an array using Go (Golang)
Overview Convert singly linked list into an array using Golang Input singly linked list: Output array: Program Output: