Browse
Hewlett Packard Enterprise Community
Sign In
Help
Community Home
>
Servers and Operating Systems
>
Operating Systems
>
Operating System - HP-UX
>
regular expression
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Printer Friendly Page
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
regular expression
SOLVED
Go to solution
Erol KAHRAMAN
Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
02-28-2007
08:45 AM
02-28-2007
08:45 AM
regular expression
hi guys,
may be this is very simple question but i can't found the answer.
I need to match
** (two star)
with regular expression.
i tried
sed s/\*\*/something/ file
sed s/*{2}/something/ file
sed s/\*+/something/ file
...
any suggestion
Solved!
Go to Solution.
All forum topics
Previous Topic
Next Topic
4 REPLIES
4
James R. Ferguson
Acclaimed Contributor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
02-28-2007
08:51 AM
02-28-2007
08:51 AM
Re: regular expression
Hi Erol:
# sed -e 's/\*\*/something/' file
Regards!
...JRF...
OldSchool
Honored Contributor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
02-28-2007
08:52 AM
02-28-2007
08:52 AM
Re: regular expression
sed 's/\*\*/new/' file
A. Clay Stephenson
Acclaimed Contributor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
02-28-2007
08:53 AM
02-28-2007
08:53 AM
Re: regular expression
Quotes matter:
sed 's/\*\*/something/g' file > outfile
will replace every occurence of "**" with "something".
If it ain't broke, I can fix that.
Erol KAHRAMAN
Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
02-28-2007
08:58 AM
02-28-2007
08:58 AM
Re: regular expression
thanks guys,
that is the answer.