4 ms·
s/academia/every career/g
by chadlavi 6y ago
s/academia/every career/g
- TheSpiceIsLife 6y agoDoes the s/ here mean substitute? What is the /g in this context? Is this the regular expression flag for global search? Sorry, not a programmer just a dumb tradie.
- Myrmornis 6y agoYes that's exactly right on both counts.
- ip26 6y agoYou're either joshing with us or you have a bright undiscovered future ahead of you in regexp's- given your apparent intuition for them.
- TheSpiceIsLife 6y agoI was kinda hoping I’d read HN for a decade or so then get a job as senior software engineer or systems architect, without all the intervening effort ;)
- jagannathtech 6y agoSo I'm not alone with my genius idea.... dang
- yesenadam 6y agoYes. Not easy to google! From the sed manual ('man sed'): s/regular expression/replacement/flags – Substitute the replacement string for the first instance of the regular expression in the pattern space. ... g – Make the substitution for all non-overlapping matches of the regular expression, not just the first one.
- fastball 6y agoFun fact: you can use sed's replace syntax to do a replace in your last message on Discord.