0

Here is a section in my .ini file

[section]
section[host] = "localhost"
section[username] = "user"
section[password] = "password.123"
section[db] = "dbname"

I want the values of section[host]. I know I am supposed to use regex for this. But not able to make it run.

Raj Nandan Sharma
  • 3,401
  • 3
  • 29
  • 40
  • Welcome to Stack Overflow. SO is a question and answer site for professional and enthusiast programmers. The goal is that you add some code of your own to your question to show at least the research effort you made to solve this yourself. – Cyrus Mar 14 '20 at 09:51
  • ... And? Did you already tried something? Please post code you wrote! – F. Hauri Mar 14 '20 at 09:51
  • `sed -nE 's/section\[host\] *= *"([^"]*)"/\1/p'` – Aaron Mar 14 '20 at 09:51
  • @Cyrus whit 2'7kRep, 140 post and 6year, there is no new SO user! – F. Hauri Mar 14 '20 at 09:52
  • @F.Hauri: He's acting like a new user, though. – Cyrus Mar 14 '20 at 09:55

0 Answers0