I’m new to Ruby (and Regular expressions in general) and as such,
this is rather a newbie question but I’m trying to write a script in
Ruby to open a file and do some string manipulation.
Basically I’m getting hung up with regular expressions.
Suppose there is a file that contains, among other lines, lines of the
“This  points to ”
Assume the line structure (words, spaces etc.) stay constant.
The actual numbers (within the brackets) are not constant.
There is always 10 numbers within the brackets.
There are other lines that have numbers enclosed by ‘[’,’]’ that must
be left alone.
How can you replace only those numbers in the above structure to
Openning a file, searching the file, writing to the file I’m presuming
is simple but the expression to identify and then replace those numbers
are giving me problems. Any help would be greatly appreciated.