Event Rule - Regular Expression to remove a certain part of the String

Ashok10
Mega Expert

Hi There,

I am trying to write a regular expression in the event rule Transform section. I am getting extra characters in FQDN and i am trying to remove them.

The example strings are :

abcd-asm.vdcunix.local

abcdasm.vdcunix.local

i am trying to remove asm and -asm from the string. I used (\|*-asm|asm\|*) but it is returning as Unknown . 

Expected outputs is:  abcd.vdcunix.local

Kindly help me with expression here.

14 REPLIES 14

I don't think that this is achievable with just one reg expression, the only approach is what Patrick has suggested.

Thank you so much for the reply. 

In another scenario of mine i want to get first two words of a parameter.For example if the field value is "Application1 Prod have issues", i want to extract only Application1 Prod.

I tried with ([^\s]+\s+[^\s]+) this is not working.

Can you please help me here. 

Thank you so much for the reply. 

In another scenario of mine i want to get first two words of a parameter.For example if the field value is "Application1 Prod have issues", i want to extract only Application1 Prod.

I tried with ([^\s]+\s+[^\s]+) this is not working.

Can you please help me here. 

I would go with After Business Rule on record Update.

Try (^\S*\s\S*)