regex to find lines starting with `*` and ending with `)` in eclipse using regex search -


i trying use regular expressing in eclipse find lines mentioned below.

i have text file text.txt:

teeet() *test() *test * () test  asdgaer () * test() 

i want find regex find lines starts * , ends )

sample output :

*test() * () * test() 

here have far :

grep "^\* . )$" test.txt 

the output blank.

i tried :

grep "^\*" test.txt 

the out put :

*test() *test * () * test() 

also tried :

grep ")$" test.txt  

the output :

teeet() *test() * () asdgaer () * test() 

combined them, didn't work expected.

you can use:

grep '^\*.*)$' file *test() * () * test() 

or else:

grep -e '^\*.*\)$' file 

you must keep .* between starting * ending ) match arbitrary data in between.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -