sed and wildcard meta characters

sed and wildcard meta characters

Post by Campbell Web » Tue, 18 Sep 2001 16:36:58



Hi All,

I am trying to determine what the wildcard character in a sed replace
statement is.  In short I am trying to determine the following where '*' is
an indeterminate sum of characters.

s/xyx*/abc/g

If anyone could provide me with the correct meta character for a wildcard in
a sed statement it would be greatly appreciated.

--
C.
___________________________________________________________________
Campbell Webb
Director Web Architecture, Collaboration and Automation - Global IT

Oracle Corporation
500 Oracle Parkway
Redwood Shores
California 94065



___________________________________________________________________
The statements and opinions expressed herein are my own and do
not necessarily reflect those of Oracle Corporation.

 
 
 

sed and wildcard meta characters

Post by Aleksandar Milivojevi » Tue, 18 Sep 2001 17:17:31



> Hi All,

> I am trying to determine what the wildcard character in a sed replace
> statement is.  In short I am trying to determine the following where '*' is
> an indeterminate sum of characters.

> s/xyx*/abc/g

> If anyone could provide me with the correct meta character for a wildcard in
> a sed statement it would be greatly appreciated.

"man -s 5 regex".  It's all there (and a lot more).

In short, what you want is "xyx.*".  "." mathces any single character
and "*" matches zero or more consecutive occurences of whatever is on
the left of it.

--

Opinions expressed herein are my own.
Statements included here may be fiction rather than truth.

 
 
 

1. shell variable to include wildcard character

I'm having a problem getting a shell variable to include a wild card
character, without the unix environment expanding the variable.  Basically I
would like the variable to reflect the string "filename.*"  However,
although I am aware that you can preceed the * by another character which
will stop the unix environment from interpretting it, I'm at a loss as to
what that particular character is.

2. Samba configuration

3. tcsh 6.03 isn't expanding wildcard characters on HP-UX 9.01

4. System V r.4 versions question

5. Wildcard characters and rc

6. MQueue

7. Wildcard characters in Apache 1.1.1 scriptalias?

8. Socket message on app exit in SCO Unix

9. Wildcards in SED?

10. Passing Quoted Wildcard Characters to a C Program

11. Meta characters in tcsh

12. problem : using meta-characters in setting user password