preg_match all words start with an @?

前端 未结 5 1856
栀梦
栀梦 2021-01-25 08:05

i\'m not very firm with regular Expressions, so i have to ask you:

How to find out with PHP if a string contains a word starting with @ ??

e.g. i have a string l

5条回答
  •  青春惊慌失措
    2021-01-25 09:05

    Match anything with has some whitespace in front of a @ followed by something else than whitespace:

    $ cat 1812901.php
    
    
    
    $ php 1812901.php 
    100
    

提交回复
热议问题