Syntactic Confectionery Delight | |
PerlMonks |
Re: A little golfing challenge: Replacing letters with numbersby rsFalse (Chaplain) |
on Feb 21, 2019 at 17:27 UTC ( [id://1230317]=note: print w/replies, xml ) | Need Help?? |
haukex: "... solution to produce such a regex character set for any given list of letters." E.g. OUTPUT: Corresponding link. For having dashes between VW and YZ I tried to use this: ..but somehow got: A--IK--NP--TV-WY-Z :( And these worked fine: s/(?<=\b\w)\w*(?=\w\b)/-/gr, s/(\w)\w*(\w)/$1-$2/gr --> A-IK-NP-TV-WY-Z :)
In Section
Seekers of Perl Wisdom
|
|