I’m new to regular expressions in php.
I have a long string of html. I want to find all occurences of:
@any_username_after_an_at_sign
Could somebody help me recover all of the usernames on a page?
I think you use preg_match but I don’t know the regular expression to use.
Thanks!!
You could try:
But this might pick up some false matches, such as parts of email addresses. Can you tell us something about the context?
It might also be relevant to consider using an HTML parser, although without more information it is hard to be sure.