2012-02-10 76 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

相關問題