Overview Question Mark is the optional operator in regex. This means that it optionally matches the preceding character before the question mark Eg. This will match both “abc” and “abcd”. Program Let’s…
Author: admin
Reverse Doubly Linked List in Go (Golang)
Overview A Doubly Linked List can be reversed by below two methods: By swapping previous and next pointers of nodes. By using stack In this tutorial, we will cover the first method…
Doubly Linked List in Go (Golang)
Overview A Doubly Linked List contains three fields in its node. Data field One Next pointer points to the next node in the list One Previous pointer which points to the previous…
Understanding Print function in Go (Golang)
Overview Print is defined in the fmt package and is used to format a string and write to standard output Below is the function prototype of Print Print formats the string using…
Understanding Printf function in Go (Golang)
Overview Printf is defined in the fmt package and is used to format a string and write to standard output https://golang.org/pkg/fmt/#Printf Below is the function prototype of Printf Printf formats the string…
Understanding Println function in Go (Golang)
Overview Println is defined in the fmt package and is used to format a string and write to standard output https://golang.org/pkg/fmt/#Println Below is the function prototype of Println Println formats the string…
Golang Regex: Backreferences
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…
Golang Regex: Replace all string which matches a Regular Expression
Overview Golang regexp package provides a method which provides a method named ReplaceAllString which given a string can be used to replace all substring within that string that matches a regular expression. https://golang.org/pkg/regexp/#Regexp.ReplaceAllString Below…
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: Matching raw or literal string
Overview We will be using regexp package in golang in our example that provides regular expression searching capabilitieshttps://golang.org/pkg/regexp/ Before looking into the regex itself, let’s look at some basic functions or methods…