School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 309,262 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,454 people online right now. Registration is fast and FREE... Join Now!




Simple RegEx Question

 

Simple RegEx Question

prelic

18 Feb, 2009 - 02:40 PM
Post #1

New D.I.C Head
*

Joined: 13 Feb, 2007
Posts: 21


My Contributions
So I'm trying to change c99 style comments ( // some stuff )
into c89 comments
( /* some stuff */ ) (ignore the parenthesis)
I'm trying to use grep, but regex is so frustrating. Any tips would be greatly appreciated

This post has been edited by prelic: 18 Feb, 2009 - 02:42 PM

User is offlineProfile CardPM
+Quote Post


mocker

RE: Simple RegEx Question

18 Feb, 2009 - 02:54 PM
Post #2

D.I.C Regular
Group Icon

Joined: 14 Oct, 2007
Posts: 440



Thanked: 38 times
Dream Kudos: 25
My Contributions
grep's regex isn't that great. egrep is better for searching with a regular expression, and sed is better at manipulating a file with regexes.

sed 's/\/\/(.+?)/\/\*\1\*\//'
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/26/09 10:16AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month