nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How to find different type of words (pattern matching) in vi

This is a discussion on How to find different type of words (pattern matching) in vi within the Linux software forums, part of the Linux Getting Started category; I'm using vi under RED HAT LINUX 4 I'm trying to find out the following all occurrence of words using ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 06-06-2005, 12:41 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
My distro: Suse, RHEL, Vista
Posts: 154
Rep Power: 4
sweta will become famous soon enough
Default How to find different type of words (pattern matching) in vi

I'm using vi under RED HAT LINUX 4

I'm trying to find out the following all occurrence of words using
single vi command

UNIX Linux
UNIX LINUX
Unix-Linux
Unix LINUX

I know / command in vi but dunno how to match all these words.. Looking
for solution desperately
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-06-2005, 06:26 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Press Escape key followed by / type and the words, so that command looks like as follows:
Code:
/UNIX[- ]L[Ii][Nn][Uu][Xx]
[- ] : match <E2><80><93> or empty single space

[Ii] : match CAPTIAL I or small i
Reply With Quote
  #3 (permalink)  
Old 06-07-2005, 11:22 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

if you are using vim then easy way out for you run set command and then search commad:

: set ic

/unix[- ]linux
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
pattern search with numbers mercuryshipz Coding in General 0 02-15-2008 12:16 AM
Search Pattern And Arrays mercuryshipz Coding in General 1 02-11-2008 03:26 PM
diff command to exclude files that match pattern piggy Getting started tutorials 1 08-13-2007 11:52 PM
linux bash misspelled words? Shell scripting 2 01-02-2006 03:22 AM
searching for bad words script marinm Shell scripting 1 02-03-2005 05:32 PM


All times are GMT +5.5. The time now is 07:49 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36