Service Naming using Regex

I am stumped!  I am trying to setup a service naming rule using the Detected Service Name.  In this case, I would only like the bolded text - (/mothership).  How do I extract only this word using Regex?

I have tried -

  • ^[a-zA-Z0-9]*+
  • \/(?>.+)

For these attempts, I get close, but still have varying results.  I want to remove the slash and the () and only have the word.

What I really want is this…

Detected Service Name - “Default Web Site:80 (/mothership)” >>>>> “mothership”

{Service:DetectedName]

Web Request Service; .NET

Detected service name contains regex

While this is very primitive, you could try (…).$ but then again that would be static on the number of characters

Have you considered just skipping the regex entirely and using the {Service:WebContextRoot} placeholder?

You could then remove the slash with regex if really needed…

While a good answer, this solution doesn’t completely solve the problem.  I’d like to clean up the default name which includes “:80 (/app)” or “:80, :443 (/app)”, etc. and only have the name of the app pool or web request service.  The goal here is to clean up these extraneous characters as they are being imported into ServiceNow.

What output are you looking for specifically? Can you provide another example? This screenshot shows a preview of how Dave’s rule above would work - does this not match your initial request?

Solution works.