[10] Results

Golang : Regular Expression for alphanumeric and underscore

golang regular-expression

Problem : Need a regular expression that only allows upper, lowercase characters, underscores and numbers for Go. Solution : Use this regular expression "^[a-zA-Z0-9_]*$" Explanations:….... read more

Golang : Validate hostname

golang validate hostname regular-expression regexp compile

Problem :

You need to validate if a given string is a valid hostname or not. Hostnames such as :

.... read more

Golang : Extract part of string with regular expression

golang regular-expression regexp extract-string

Below is a simple example of how to extract a specific part of a string with the help of regular….... read more

Golang : Underscore string example

golang underscore regexp regular-expression trim


Your program needs to process data with whitespaces and quotes. You need a quick way to remove underscore characters….... read more

Golang : Use regular expression to get all upper case or lower case characters example

golang regular-expression regexp string upper lower

This is an add-on for the previous tutorial on how to get all upper case or lower case….... read more

Golang : error parsing regexp: invalid or unsupported Perl syntax

golang regular-expression unsupported-perl-syntax

Compiling and running Golang program will throw out some odd error messages sometimes. Got one today with this error message….... read more

Golang : Create unique title slugs example

golang title-slug database-query seo regular-expression

A simple example on how to create title slug from a string and also demonstrate what you can do in….... read more

Golang : Validate IP address

golang validate ip-address regular-expression regexp compile

Problem :

You need to validate if a given IP address string is a valid IP address.

Solution :

Use….... read more