I want, from a given file, output to a new file the lines containing a
word (the example was "Bourgogne") given as the third arg of the script.
Notice i'm able to do that in a "static" way that's to say changing the
word in the script's regexp, what i don't know is the correct syntax to
replace this word by a variable in the regexp, the variable being a
String (ARGV[2].to_s).
···
Markus <markus@reality.com> wrote:
I am not sure exactly what you are asking, so I will offer multiple
suggestions and you can see what works best for you:
"Yvon Thoraval" <yvon.thoravalNO-SPAM@free.fr> schrieb im Newsbeitrag
news:1gl6f5h.1hzh8w1ct4lg5N%yvon.thoravalNO-SPAM@free.fr...
> I am not sure exactly what you are asking, so I will offer multiple
> suggestions and you can see what works best for you:
Thanks for your answer, i need to clarify...
I want, from a given file, output to a new file the lines containing a
word (the example was "Bourgogne") given as the third arg of the script.
Notice i'm able to do that in a "static" way that's to say changing the
word in the script's regexp, what i don't know is the correct syntax to
replace this word by a variable in the regexp, the variable being a
String (ARGV[2].to_s).
--
yt
What strikes me odd is the rest of your regexp, especially the square
brackets. If you just want to match a certain word as word in the line
you should probably use these ones:
What strikes me odd is the rest of your regexp, especially the square
brackets.
If you just want to match a certain word as word in the line
you should probably use these ones: