fork download
  1. str =<<DATA
  2. [example.com]
  3. 10.100.251.1
  4. 10.100.251.2
  5. 10.100.251.3
  6. [example.net]
  7. 10.100.251.22
  8. 10.100.251.33
  9. DATA
  10. rx = /^\[example\.com\]\R*(?:(?:\d{1,3}\.){3}\d{1,3}\R*)*/
  11. puts str[rx]
Success #stdin #stdout 0.02s 9720KB
stdin
Standard input is empty
stdout
[example.com]
10.100.251.1
10.100.251.2
10.100.251.3