Grep a block of code


#1

Hi

Lately someone gave me a task, to grep from csv file but a block of
code.
How to do it ?

for example

2 3 4 5

How to use grep to give me all form file wich start with and end
with

I’ve tried that way…

puts File.readlines(ARGV[0]).grep(/ * </tag>/)

Please help


#2

From: “Maciej Pindela” removed_email_address@domain.invalid

I’ve tried that way…

puts File.readlines(ARGV[0]).grep(/ * </tag>/)

puts ARGF.read.scan(/.*?</tag>/m)

Regards,

Bill


#3

Bill K. wrote:

From: “Maciej Pindela” removed_email_address@domain.invalid

I’ve tried that way…

puts File.readlines(ARGV[0]).grep(/ * </tag>/)

puts ARGF.read.scan(/.*?</tag>/m)

Regards,

Bill

Thanks that’s works