import { Injectable } from '@angular/core' ; @ Injectable ( ) export class RegexService { param search returns regexQuery ( search ) { if ( /\/([\s\S]*?)\// . test ( search ) ) { return new RegExp ( /\/([\s\S]*?)\// . exec ( search ) [ 0 ] . slice ( 1 , - 1 ) , /[^/]*$/ . exec ( search ) [ 0 ] ) ; } return null ; } }