Skip to main content

extract Example@ from Example@domain.com

@vanitharaj1208 I hope these 2 regex pattern helps:

Extracts everything from username part of email with @
Extracts everything from username part of email without @

 


i tried its not working thats why i asked the question


@vanitharaj1208 both regex patterns works for me:


1. with @ 



Result during ingestion (before regex):




 


2. without @ 



 



 


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



 


 


 


 


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



its not working

 


its not working

 


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



 


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


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



 


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


 


Reply