LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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

Reply
 
Search this Thread
Old 03-19-2009, 10:03 PM   #1
pcock
LQ Newbie
 
Registered: Sep 2004
Location: Sydney, Australia
Distribution: Archlinux
Posts: 16

Rep: Reputation: 0
[SOLVED] regular expression comma between brackets


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-19-2009 at 11:01 PM.
 
Old 03-19-2009, 10:26 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
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
 
  


Reply

Tags
processing, regex, sed, text


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:41 AM
Regular Expression harkonen Programming 6 07-12-2008 12:06 PM
Do we have regular expression in C++ ? indian Programming 4 03-06-2006 09:54 AM
Regular expression datbenik Programming 1 01-05-2006 01:58 PM
Anyone know regular expression? ahhua Linux - Software 1 12-04-2003 08:13 AM


All times are GMT -5. The time now is 04:40 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration