LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   regular expression comma between brackets (https://www.linuxquestions.org/questions/programming-9/regular-expression-comma-between-brackets-712993/)

pcock 03-19-2009 10:03 PM

[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

ta0kira 03-19-2009 10:26 PM

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


All times are GMT -5. The time now is 11:58 PM.