[CLUE-Tech] Regular Expression in ViA

Keith Hellman kehellman at yahoo.com
Fri Mar 22 14:37:27 MST 2002


:%s/\([0-9]\)-\([0-9]\)/\1\2/g

--- Randy Arabie <randy at arabie.org> wrote:
> I'm having a brain cramp with regard to regular expressions in 
> vi.
> 
> I have a text file I'm preparing for an import into a db.  I need 
> to remove all the hypens from the phone numbers in one field.
> 
> I tried:
> 
> 	:%s/[0-9]-[0-9]//g
> 
> Which removed all of the hypens, AND all the numbers on either side :-(
> 
> I can't replace all hyphens, as there are some in other fields.  It is 
> safe to replace ANY hyphen BETWEEN two numbers.
> 
> If possible, please CC randyarabie at enecotech.com on any response.
> 
> TIA
> 
> -- 
> Cheers!
> 
> Randy
> 
> ================================================================
> Randy Arabie
> GnuPG Key Info -- 
> 
>  Fingerprint: 7E25 DFA2 EF72 9551 9C6C  8AA6 6E8C A0F5 7E33 D981
>  Key ID: 7C603AEF
>  http://www.arabie.org/keys/rrarabie.gnupg
> ================================================================
> 
> _______________________________________________
> CLUE-Tech mailing list
> CLUE-Tech at clue.denver.co.us
> http://clue.denver.co.us/mailman/listinfo/clue-tech


=====
Keith E. Hellman
kehellman at yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/



More information about the clue-tech mailing list