Regex for Host File Entries
by Captain Database on Sep 21st in Regex
Since I’m rather addicted to regex, I always end up finding ways to use them for text parsing. I randomly felt the need to make one for host file entries: ^([^#\s]*)?\s*([^#\s]+\s*)*(#.*)?$ I know it might look like it’s more complicated than it needs to be, but this expression makes the entire parsing process incredibly simple. [...]