Re: Regex for white space

From: William Park (opengeometry_at_yahoo.ca)
Date: 11/23/05


Date: Wed, 23 Nov 2005 14:57:06 -0500

Ying Zu <nye@shao.ac.cn> wrote:
>
> Suppose a series of white spaces in between a string, just like"
>
> "foo fooo foooo fooooo"
>
> Now I wonder how can I get a new string contains no spaces or substuted by symbols like _
>
> Maybe a simple regex use but I am a newbie in shell script...
>
> thanks :)

man tr (-s)

-- 
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
	   http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
	  http://freshmeat.net/projects/bashdiff/


Relevant Pages

  • Re: How can i Right Trim all the spaces of a very long (2000 chars) Charecter string ?
    ... > Right Trim Function in c,using Binary search kind of fast algorithm? ... > Start from the right most charecter of the string to the left of the ... Is the string allowed to contain white spaces in the significant part? ...
    (comp.lang.c)
  • Re: VB help
    ... retrieving the a srting value in the database through a record ... retrieved string shows some junk charecters in place of white spaces ... string in the database 8a Church Road Barry ...
    (microsoft.public.vb.general.discussion)
  • Re: Regex for white space
    ... > Suppose a series of white spaces in between a string, ... > Now I wonder how can I get a new string contains no spaces or substuted by symbols like _ ... Lew Pitcher, IT Specialist, Enterprise Data Systems ...
    (comp.unix.shell)
  • Re: Is there any function as Trim in Jscript/JavaScript?
    ... > Is there any function as Trim in Jscript/JavaScript? ... > not find anything untill now. ... > a string with some or a lot of white spaces. ...
    (microsoft.public.scripting.jscript)
  • Re: awk and regexp in BASH
    ... > I have a string like this: ... > Using Perl I can access the fields with the next regexp: ... BashDiff: Super Bash shell ...
    (comp.unix.shell)

Loading