LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Tags used in this thread
Popular LQ Tags , , ,

Reply
 
Thread Tools
Old 03-19-2009, 11:03 PM   #1
pcock
LQ Newbie
 
Registered: Sep 2004
Location: Sydney, Australia
Distribution: Archlinux
Posts: 16
Thanked: 0
[SOLVED] regular expression comma between brackets


[Log in to get rid of this advertisement]
Hi,

Can someone help show me how do I work this out.
Code:
echo "numeric(16,3)" | sed 's/numeric(\d*\,\d*)/real/g'
Desired output:
Code:
real
Thanks

Last edited by pcock; 03-20-2009 at 12:01 AM..
pcock is offline  
Tag This Post , , ,
Reply With Quote
Old 03-19-2009, 11:26 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: Slackware 11.0, Slackware 12.1, slamd64 12.2, Ubuntu Server 8.04, Kubuntu 9.04
Posts: 2,081
Thanked: 39
I always find it easier to force extended regexes with -r for sed or I'll egrep instead of grep:
Code:
sed -r 's/numeric\([0-9]+,[0-9]+\)/real/g'
Kevin Barry
ta0kira is offline     Reply With Quote
Thanked by:

Reply

Bookmarks


Thread Tools

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
regular expression Ammad Linux - General 5 08-01-2008 08:41 AM
Regular Expression harkonen Programming 6 07-12-2008 01:06 PM
Do we have regular expression in C++ ? indian Programming 4 03-06-2006 10:54 AM
Regular expression datbenik Programming 1 01-05-2006 02:58 PM
Anyone know regular expression? ahhua Linux - Software 1 12-04-2003 09:13 AM


All times are GMT -5. The time now is 07:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration