Extract username from Email using Regex in ontology mapping

vanitharaj1208_0-1723506734839.png

extract Example@ from Example@domain.com

Solved Solved
0 7 392
2 ACCEPTED SOLUTIONS

@vanitharaj1208 both regex patterns works for me:

1. with @ 

f3rz_0-1723539603766.png

Result during ingestion (before regex):

f3rz_1-1723539637958.png

f3rz_2-1723539683261.png

 

2. without @ 

f3rz_3-1723539737139.png

 

f3rz_4-1723539749386.png

 

To view values after mapping process I clicked on "Show results" under 3-dot menu:

f3rz_5-1723539798506.png

 

 

 

 

View solution in original post

I think it is working, to validate the result you need to click 3-dot icon as shown on a screenshot:

f3rz_0-1723621266902.png

 

When you howerover your mouse above "green" mapped value, it shows only original value, but not end result of mapping.

View solution in original post

7 REPLIES 7

i tried its not working thats why i asked the question

@vanitharaj1208 both regex patterns works for me:

1. with @ 

f3rz_0-1723539603766.png

Result during ingestion (before regex):

f3rz_1-1723539637958.png

f3rz_2-1723539683261.png

 

2. without @ 

f3rz_3-1723539737139.png

 

f3rz_4-1723539749386.png

 

To view values after mapping process I clicked on "Show results" under 3-dot menu:

f3rz_5-1723539798506.png

 

 

 

 

According to our documentation , regular expressions supports look ahead and look behind, but does not support groupings. The former method should be sufficient for isolating a username from an email address. Could there have been a difference if versions of SecOps between these examples and if so maybe there has been a change in regex. instead of "\w" try a greedy wild card ".*" to see if it could be the special character "\w (word character)"  not working correctly

vanitharaj1208_0-1723584937958.png

its not working

vanitharaj1208_1-1723585363999.png

 

I think it is working, to validate the result you need to click 3-dot icon as shown on a screenshot:

f3rz_0-1723621266902.png

 

When you howerover your mouse above "green" mapped value, it shows only original value, but not end result of mapping.

Agreed, I tested here as well and the look ahead works, but note that if the user has a " . " in the name like Joe.smith@acme.com, then you will only get "smith" if your regex is "  \w+?(?=@)  ", you may be better off using the wild card in the regex like "  \w+.*(?=@) ". 

When I checked the result in the vertical dot menu, my result was as expected