Jump to content

Any advice on String Utils or Regex please?


Berto2002
 Share

Recommended Posts

I have the following naming convention for the Telephone Number Asset in the database:

"Telephone DDI - 01702 215761 - Ext 5761"

Sometimes, I just want to refer to the actual number only, "01702 215761"

I just know there is a way to do this and it's likely to be something in Utils but I lack the experience/skill to work it out.

Our consultant on implementation put this in one of our workflows to extract the UserID from the fully-resolved name with ID but I don't really know how it works:

This Expression seems to strip-out everything that is not between the brackets in a string like this: "FirstName SecondName (FirstNameSecondName@org.gov.uk)" and gives the result, "FirstNameSecondName@org.gov.uk"

image.png.afb9eacc2cba34dc58104268318bdd7f.png

 

Link to comment
Share on other sites

Hi @Berto2002, Thank you for your post.  You can modify the above regular expression to look for the first -{space} (?<=-\s) and strip out all characters  (.*?) up to the next {space}- (?=\s-).  The full expression would look like the following  (?<=-\s)(.*?)(?=\s-).  

Regards,

Ricky Fearon

Product Specialist

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...