Saturday, January 2, 2010

Re: Patterns, variables and strange behavior of some thing.

>There's a better way to do what you're trying to do, which uses \zs
>instead of \@<=.
Thanks.
Mmmm. But if i use "\zs" instead "\@<=" in next example - he not work at
all.
"\(\(int\|long\|short\|char\|void\|double\)[[:space:]]\+\)\@<=[^[:space:]^(^).]\+\([[:space:]]\)\@="

But in litle experimental examples this work. But I with it will experiment
with it.

>Out of curiosity, what are you trying to match with [^[:space:]^(^).]?
Word, which does not contained "( )". I finding a variables, but not
functions, and declarations of classes.
"int frog" - it will be found. "int frog()" - it will be not found.

>Now I'm confused as to what you're actually attempting to do...
I not so understand programming, I study him likely.
Now i simply learn to work in the editor of a code, and try to do my own
syntax highlighting.
In this stage - i try make variables highlighting.

"(type (name_variables)some_simvols)\@<=(\2)"

As it not were correctly work in the next example.(this can find only one
simvols of the word )), but in this variant the example looks easier, and it
is not similar to spells of severe northern mammoths.)
string " int d ii iiii ii d"
pattern '\(int[[:space:]]\+\([^[:space:]]\+\).*\)\zs\2'

P.S. And one little question.
This string "oooooooBBoooooooBoooo"
And patterne '\(B\)\=\1'
Why this patterne not work? :WALL:
This is too quirk? )
--
View this message in context: http://old.nabble.com/Patterns%2C-variables-and-strange-behavior-of-some-thing.-tp26986520p26994865.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment