Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php regexp,如何查找不带';不包含某个字符?_Php_Regex - Fatal编程技术网

Php regexp,如何查找不带';不包含某个字符?

Php regexp,如何查找不带';不包含某个字符?,php,regex,Php,Regex,我有一组字符: peach_addict 612 EmailName 747 littefooted@aol 805-582-73 748 cell is pager number 762 (805) Parents Home

我有一组字符:

peach_addict                              612        
EmailName                                 747        
littefooted@aol  805-582-73             748        
cell is pager number                      762        
(805) Parents Home                        765        
Star 82                                   777          
Moms cell                                 1198       
MOM LISA                                  1223       
LUVMARTIA82OL@AOL.                        1342       
ISABLGUTIRREZ@BAMMDELS                    1349  
我想选择不包含
@
符号的每一行

如果我这样做,
++.
我将得到以下几行:

littefooted@aol  805-582-73             748
LUVMARTIA82OL@AOL.                        1342       
ISABLGUTIRREZ@BAMMDELS                    1349 
但是我想要其他的。我知道我可以使用
^
符号,但这不起作用:
[^(+@.+)]

有什么想法吗

谢谢

正确的语法是

^[^@]*$

这意味着:

^ - beginning of line
[ - start of character class
^ - any character except the following
] - end of character class
* - 0 or more
$ - end of line
我在正则表达式教程中取得了很好的效果。

正确的语法是

^[^@]*$

这意味着:

^ - beginning of line
[ - start of character class
^ - any character except the following
] - end of character class
* - 0 or more
$ - end of line

我在正则表达式教程中取得了很好的效果。

@Patrioticcow,你必须有多行标志,在我将其与句点放在同一行之前,这有点让人困惑。@Patrioticcow,你必须有多行标志,在我将其与句点放在同一行之前,这有点让人困惑。