© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
43 replies
Chris TCC

✅ help with regex

I'm trying to learn regex, have watched multiple tutorials and checked multiple websites, but can't fully grasp how to use it for my specific situation.
I want to find and retrieve a certain part out of a string: the word that follows an @.
currently I have this:
^@[a-zA-Z0-9]+$
^@[a-zA-Z0-9]+$

Here are some example cases:
word @something
word @something
-> true
@something
@something
-> true
word@something
word@something
-> false
I'd like to be able to retrieve the
@something
@something
from those examples, whilst ignoring the rest. Would my regex work? I've tried it with this website (https://regexr.com) but it doesn't seem to work...
RegExr
RegExr: Learn, Build, & Test RegEx
RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp).
RegExr: Learn, Build, & Test RegEx
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Help with a regex
C#CC# / help
15mo ago
❔ Help with simple regex
C#CC# / help
4y ago
Regex help.
C#CC# / help
11mo ago
❔ REGEX help!
C#CC# / help
3y ago