Reputation: 113
Test string:
best.string_a = true;
best.string_b + bad.string_c;
best.string_d ();
best.string_e );
I want to catch string that after '.' and followed by anything except '('. My expression:
\.\@<=[_a-z]\+\(\s*[^(]\)\@=
I want :
string_a
string_b
string_c
string_e
But it doesn't work and result :
string_a
string_b
string_c
string_d
string_e
I am new to vim regex and i dont know why :(
Upvotes: 2
Views: 517
Reputation: 8248
Make this \.\@<=\<[_a-z]\+\>\(\s*(\)\@!
This matches:
\.\@<= Assure a dot is in front of the match followed by
\<[_a-z]\+\> A word containing only lowercase or '_' chars
\(\s*(\)\@! not followed by (any amount of spaces in front of a '(')
Upvotes: 2