Vim Match problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Vim Match problem
# 1  
Old 05-12-2012
[SOLVED] Vim Match problem

Goodmorning,
I've some problem in using regular expression in a VIM syntax configuration file.
I've need to match a string as <<< some to match >>> so that it matches only some to match .
With standard regular expression i know that for this goal works fine the regex:

(?<=<{3}).*(?=>{3})

but in Vim syntax files this doesn't work. I've tested
\(?<=<\{3\}\).*\(?=>\{3\}\)
or
\(\?\<\=<\{3\}\).*\(\?\=>\{3\}\)
but nothing, since in this later when I'm opening the file, it turns always the error
"E:64 \? follows nothing".
I'm sorry about my disgusting English! Smilie

Thank for reads

Last edited by keltron; 05-12-2012 at 12:26 PM..
# 2  
Old 05-12-2012
Code:
\(<<< \)\@<=.*\( >>>\)\@=

# 3  
Old 05-12-2012
Wow, thank you so much!
Can you explain what "\@" means and do?? I would like to learn more about this powerfull trick! Smilie
# 4  
Old 05-12-2012
Type :help \@=in vim.
# 5  
Old 05-12-2012
Thanks for your patience! I'm very niubb and didn't know ever the help!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem to match a path in a file and put it into a variable

Hello,:p I made a script which do a backup on remote servers with a rsync command. I have a config.cfg with the IPs and the paths where it will copy the directory. The problem is that it doesn't match the paths, So, here my script and its output with the debug : #!/bin/bash # PATHS... (7 Replies)
Discussion started by: Arnaudh78
7 Replies

2. Shell Programming and Scripting

Vim : Match all bracket { and fold them (zf%)

Hello ! I'm using a lot the command zf% with the cursor on the first bracket of a function for example, to fold it. Ex : I put my cursor on the first bracket myfunction(){ # body } I type zf% It become : +-- 9 lines : myfunction()... (2 Replies)
Discussion started by: Purgator
2 Replies

3. Shell Programming and Scripting

Problem getting Nth match in sed

Hi all, I'm trying to create a sed command to get the Nth instance of an XML tag in a string, but thus far I can only ever seem to get the last one. Given an XML string: <Wrap><GrayLevel>a</GrayLevel><GrayLevel>b</GrayLevel></Wrap> I tried to do this on the command line to get each... (7 Replies)
Discussion started by: Zel2008
7 Replies

4. Shell Programming and Scripting

problem using sed to match a string

Hi There! I'm stuck with a problem trying to output some sections of a rss feed to my conky program using curl and sed. The rss feed is for tide times and I wish to output the times but not the rest to the conky desktop. To do this I need to pull out the four instances of times that are in... (4 Replies)
Discussion started by: huffpuff
4 Replies

5. Shell Programming and Scripting

sed pattern match problem

Hi all, hoping this is a simple one, tried looking but just can't see the solution As an example I've got a list of words that all start Ben..... Bendicks Benefiber Ben Benylin I need to only change the line Ben with Ben 10, ignoring the other lines. I tried the following ... (1 Reply)
Discussion started by: mrpugster
1 Replies

6. UNIX for Dummies Questions & Answers

Problem to map VIM cursor moving in InsertMode

Hi all What I want? I want in Insert mode, press Alt-hjkl move cursor, and then back to insert mode. I know ctrl-o, hjkl can do the job. but everytime I want to move, i have to press ctrl-o, or I have to count how many hjkl I will do, do a C-O (n)hjkl. What I tried (example only with 'j')... (2 Replies)
Discussion started by: sk1418
2 Replies

7. Solaris

Very Importan - Vim Settings - Error while opening a File using vim

I downloaded vim.7.2 and compiled the vim source . Added the vim binary path to PATH (Because iam not the root of the box) when i load the file using vim it throws me an error Error detected while processing /home2/e3003091/.vimrc: line 2: E185: Cannot find color scheme darkblue line... (0 Replies)
Discussion started by: girija
0 Replies

8. UNIX for Dummies Questions & Answers

encountering problem with vim

while entering into vim insert mode some garbage is getting printed in to the file could some one help to avoid this . (1 Reply)
Discussion started by: Gopi Krishna P
1 Replies

9. Shell Programming and Scripting

Vim problem

Can someone explain me why sometimes the cursor can not be moved to needed position? for example: mysql -u root db -sBe "ALTER TABLE $i ENGINE=$ENGINE"; echo -e "${GG}OK${BB}"; In this line I can not go to position after $i, why? This is not first time I see such issue. "INSERT" pressed :) (0 Replies)
Discussion started by: mirusnet
0 Replies

10. Programming

Format Problem with vim

Hi, there. Everyone had a great Thanksgiving? I have a slice format problem when I am using vim to edit c++ source code. I don't know how to discribe the problem exactly. You see, usually when I use the command "vi hello.cpp" to write a code, it will have the format like this: #include... (4 Replies)
Discussion started by: HOUSCOUS
4 Replies
Login or Register to Ask a Question