Thanks for the reply, I will continue to use regex then.
And to pick up Pi-Hole on the go I will use :
pihole -r
H/T : Change ip adress - #2 by spacemonkey
The thing is when you are in a new place/network you have to have access to an HDMI screen and usb keyboard to reconfigure the static Ip directly in the Rapsberry because ssh doesn't work.