hostname regex seems to be wrong #13

Closed
opened 2025-12-29 00:21:51 +01:00 by adam · 2 comments
Owner

Originally created by @jollyjinx on GitHub (Dec 14, 2015).

Currently the regex for hostnames seems to be incorrectly escaped as hostnames like smokeping.example.com are incorrectly parsed.
I've doubled escaped the:

sed 's/^\s_//g;s/\s_$//g'

to:

sed 's/^\s_//g;s/\s_$//g'

and now it works for me.

Originally created by @jollyjinx on GitHub (Dec 14, 2015). Currently the regex for hostnames seems to be incorrectly escaped as hostnames like smokeping.example.com are incorrectly parsed. I've doubled escaped the: sed 's/^\s_//g;s/\s_$//g' to: sed 's/^\\s_//g;s/\\s_$//g' and now it works for me.
adam closed this issue 2025-12-29 00:21:51 +01:00
Author
Owner

@lukas2511 commented on GitHub (Dec 15, 2015):

Mh... tiny problem with this: BSD version of sed behaves different than GNU version...
The original line worked fine with GNU sed but had problems with BSD sed,
the "fixed" line is exactly the other way round...
Need to find a solution for this :-/

@lukas2511 commented on GitHub (Dec 15, 2015): Mh... tiny problem with this: BSD version of sed behaves different than GNU version... The original line worked fine with GNU sed but had problems with BSD sed, the "fixed" line is exactly the other way round... Need to find a solution for this :-/
Author
Owner

@lukas2511 commented on GitHub (Dec 16, 2015):

Oops well actually, the "fixed" version actually just doesn't work at all, it doesn't remove the whitespace, it just passes the line as is.

@lukas2511 commented on GitHub (Dec 16, 2015): Oops well actually, the "fixed" version actually just doesn't work at all, it doesn't remove the whitespace, it just passes the line as is.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#13