2012-02-10 78 views
0

我有这个字符集:regexp,如何找到不包含某个字符的字符串?

peach_addict        612   
EmailName         747   
[email protected] 805-582-73    748   
cell is pager number      762   
(805) Parents Home      765   
Star 82         777   
Moms cell         1198  
MOM LISA         1223  
[email protected]      1342  
[email protected]     1349 

我想选择不包含@符号每一行。

,如果我做[email protected]+我会得到这些行:

[email protected] 805-582-73    748 
[email protected]      1342  
[email protected]     1349 

,但我想其他的。我知道我可以使用^符号,但这不起作用:[^([email protected]+)]

有什么想法?

感谢

回答

4

正确的语法是

^[^@]*$

这意味着:

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

我已经与正则表达式教程here了良好的效果。

+0

我没有看到它的工作。试试这里http://gskinner.com/RegExr/ – Patrioticcow 2012-02-10 03:35:17

+1

@Patrioticcow http://regexr.com?2vver – Wiseguy 2012-02-10 03:39:07

+0

有线,当我试过它没有奏效。谢谢 – Patrioticcow 2012-02-10 03:41:15

相关问题