From: kackson@... (kackson) Date: 2002-04-16T03:22:31+09:00 Subject: need help on using Ruby to replace some SED expressions I tried sed. But it is getting really tough when I keep realizing I've things to expand and expand and expand into a huge chunk of regular expressions that now become completely unreadable and hard to maintain. So, as a beginner of Ruby, any advise on the question below is apprecaited. I need to: 1. read an input file 2. For everyline, if the FIRST word has a dot '.', replace it with $. Note, the first word may/maynot have been indented. 3. For the rest of the line, replace all occurance of '@' with '^'. 4. If there is something like '(2 + 3)' somewhere along the line, evaluate it and replace the entire expression i.e. (2 + 3) with the result, i.e. 5. Note, the brackets are gone. And it could be +, *, -, or divide. If it is even possible for mathmatical routines such as log/sin, etc. That would be even better. I'm running short of time to experiment all the powerful set of ruby methods for now. I hope some ruby expert could help. Thank you!!!