Regular expressions

Some fields on the Trustelem administration pages allow the usage of regular expressions.

  • In redirect_uri, for indicating multiple possible values

    For example, the following code allows a URL with an optional port number and trailing:

    regexp+http://localhost(:(\d)+)?/
    
  • In the applications scripts, for modifying the returned attributes

    For example, the following code changes the domain name in email addresses:

    return user.email.replace(/([^@])@./, '$1@mondomaine.io');