How To Use Regular Expressions (regex) To Forward Email In Postfix

Author: , April 7th, 2015

Create the file /etc/postfix/virtual-regexp. For example, forward all emails with a leading eric and ending with @thewyz.net to a Gmail account:

Edit the file /etc/postfix/main.cf. Add regexp:/etc/postfix/virtual-regexp to the virtual_alias_maps line. For example:

Generate the map .db file:

This example requires the files virtual and virtual.db to exist, even if they are […]

How To Use Regular Expressions In JavaScript

Author: , November 3rd, 2011

RegExp.exec(string) Applies the RegExp to the given string, and returns the match information.

match then contains [“Sample”,”amp”] RegExp.test(string) Tests if the given string matches the Regexp, and returns true if matching, false if not.

match then contains false String.match(pattern) Matches given string with the RegExp. With g flag returns an array containing the […]