Question

I have a configuration file for an application I've made, and to load the configurations I need to parse them from the config file first. I'm kind of stuck.

Here is a snippet of the config file:

#0_downloaded_url:[http://example.com/to/be/downloaded/, http://example.com/to/be/downloaded/]
#0_follow_url:http://example.com/to/be/downloaded/
#0_download_url:http://example.com/to/be/downloaded/
#0_main_url:http://example.com/to/be/downloaded/
#1_downloaded_url:[http://example.com/to/be/downloaded/, http://example.com/to/be/downloaded/]
#1_follow_url:http://example.com/to/be/downloaded/
#1_download_url: http://example.com/to/be/downloaded/
#1_main_url:http://example.com/

I want to match everything that matches: #(digit)_(text and underscores):(anything)(linebreak), so basically one line at a time. I also wanna group the results, so I get the first digit, then the text after the digit, and at last the text (in this case a url) after the semicolon.

This is what I've come up with so far:

^#\d_\w*:.*

But that isn't what I want. It only matches one row, and it doesn't group the results.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top