<div dir="ltr"><div></div><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">You’re close. I tweaked it slightly, and it works for me:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">% perl -e 'my $em = "smagill\@abcco.com1/15/1998"; $em =~ s#[\d/]+$##; print "EMAIL: $em\n";'
EMAIL: <a href="mailto:smagill@abcco.com">smagill@abcco.com</a>
</code></pre><p style="margin:0px 0px 1.2em!important">The concept is the same: work from the end, not the start of the string. I removed the parens since you don’t need them, and changed the <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">/</code> to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">#</code> to avoid “leaning toothpicks†<code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">\/</code>.</p>
<div title="MDH:PGRpdj5Zb3UncmUgY2xvc2UuIEkgdHdlYWtlZCBpdCBhIGJpdDo8L2Rpdj48ZGl2Pjxicj48L2Rp
dj48ZGl2PmBgYDwvZGl2PjxkaXY+JSAmbmJzcDtwZXJsIC1lICdteSAkZW0gPSAic21hZ2lsbFxA
YWJjY28uY29tMS8xNS8xOTk4IjsgJGVtID1+IHMjW1xkL10rJCMjOyBwcmludCAiRU1BSUw6ICRl
bVxuIjsnPGJyPkVNQUlMOiBzbWFnaWxsQGFiY2NvLmNvbTwvZGl2PjxkaXY+YGBgPC9kaXY+PGRp
dj48YnI+PC9kaXY+PGRpdj5UaGUgY29uY2VwdCBpcyB0aGUgc2FtZTogd29yayBmcm9tIHRoZSBl
bmQsIG5vdCB0aGUgc3RhcnQgb2YgdGhlIHN0cmluZy4gSSByZW1vdmVkIHRoZSBwYXJlbnMgc2lu
Y2UgeW91IGRvbid0IG5lZWQgdGhlbSwgYW5kIGNoYW5nZWQgdGhlIGAvYCB0byBgI2AgdG8gYXZv
aWQgImxlYW5pbmcgdG9vdGhwaWNrcyIgYFwvYC48L2Rpdj4=" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 20, 2024 at 2:41 PM Richard Reina <<a href="mailto:richard@rushlogistics.com">richard@rushlogistics.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Mike, Thanks for the quick reply but<br>
<br>
perl -e 'my $em = "smagill\@abcco.com1/15/1998"; my $em =~ s/([\d\\])+$//; print "EMAIL: $em\n";'<br>
<br>
<br>
<br>
<br>
gives me:<br>
<br>
Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE [\d\\]+$/ at -e line 1.<br>
<br>
Tried adding a ) after +$ but that just gives me an empty string for $em. Maybe I'm doing something wrong?<br>
<br>
<br>
<br>
On Sat, 20 Jan 2024 14:28:52 -0600, Mike Raffety <<a href="mailto:MikeRaffety@earthlink.net" target="_blank">MikeRaffety@earthlink.net</a>> wrote:<br>
<br>
s/([\d\\]+$//;<br>
<br>
Richard Reina wrote on 1/20/2024 2:24 PM:<br>
> Good day fellow perl mongers,<br>
><br>
> I have a bunch of email addresses that have been corrupted with digits (mostly dates) stuck to the end. such as smagill@abcco.com12/19/1198 I am trying to figure out what kind of regex I can use to remove the numbers and recover the pure email address. I initially thought of something like<br>
><br>
> $email =~ s/^\\D*\\d+//;<br>
><br>
> but that didn't work and I quickly realized that even if it had it would fail if there were a digit in the email address.<br>
><br>
> Any help would be greatly appreciated.<br>
><br>
> Richard<br>
> _______________________________________________<br>
> Chicago-talk mailing list<br>
> <a href="mailto:Chicago-talk@pm.org" target="_blank">Chicago-talk@pm.org</a><br>
> <a href="https://mail.pm.org/mailman/listinfo/chicago-talk" rel="noreferrer" target="_blank">https://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
 <br>
_______________________________________________<br>
Chicago-talk mailing list<br>
<a href="mailto:Chicago-talk@pm.org" target="_blank">Chicago-talk@pm.org</a><br>
<a href="https://mail.pm.org/mailman/listinfo/chicago-talk" rel="noreferrer" target="_blank">https://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
</blockquote></div>