Well, given your example of "JKDJFKDJFABCXYZJKDJFKDJF", I was wanting an expression that would allow me to return just "JKDJFKDJF". I would do that by deleting everything from "ABCXYZ" onward (e.g. REReplace with "").
But now that I've examined the string further, it appears I need to do something else. To be more specific, I'm trying to extract the SMTP e-mail addresses from the proxyAddresses attribute field in Active Directory. Here is what a typical proxyAddress attribute looks like:
SMTP:user@exampledomain.com;smtp:user1@exampledomain.com;X400:c=US\;a= \;p=First Organizati\;o=Exchange\;s=lastname\;g=firstname\;i=middleinitial\;
As you can see there are two addresses listed, but some users will have more. I want to be able to extract those from the results of an LDAP query, but I don't want any of the rest of the information... in this case the X400 onward.
But I just noticed that the order is different for some users... like this:
X400:c=US\;a= \;p=First Organizati\;o=Exchange\;s=lastname\;g=firstname\;i=middleinitial\;;SMTP:user@exampledomain.com;smtp:user1@exampledomain.com
So given that, I clearly can't simply trim everything starting with X400. So now I need something that will match and delete everthing EXCEPT the SMTP addresses (I also don't need the "SMTP:". Or do the reverse and match the email address and delete everything else. But I really have no idea how to do that. From doing some Googling I found this expression which is supposed to be able to match most e-mail addresses:
\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
But I'm not sure how to apply that to my situation.