Using the correct expression and replacement using the widespread regular expressions language, you should be able to transform usernames as long as they follow some consequent pattern. If your incoming username is firstname.lastname@example.org and you would like to have it converted to email@example.com, a regular expression could help you solve this.
One way of doing this is dividing the incoming username into groups by using this expression:
the parentheses are creating the groups
period "." indicates any symbol
star "*" means from 0 to many occurrences of the preceding symbol
The five groups can then be used as the replacement to create the new username. Each group is getting a numeral, incremental name where their name and value in the given example would be:
$1 = "jon.doe"
$2 = "_"
$3 = "teacher"
$4 = "@"
To create a new username as an output, use the variables and other symbols to build the replacement. In the given example, having the replacement set to $1$4$5 will transform from firstname.lastname@example.org to email@example.com.
Change case of username
When using just-in-time provisioning and regular expressions for username lookup, you may want to control what case usernames get. By using \L (lowercase) and \U (uppercase) in front of $1 and other replacements (see above examples), you may instruct what case the username for the newly created user will be.
So for example, if you want the domain to have uppercase for created usernames, use the expression:
and then instruct all after @ symbol to be uppercase with this replacement: