

Most of the stupidity is real.


Most of the stupidity is real.
I’m not saying the US can’t recover from this, Germany came back from worse after all, but it would take a long time. And I imagine the US turnaround would be more like Japan (pretend everything was very legal and very cool) than the full reckoning Germany had.
Although the US does love flip-flopping between extremes, so who knows? Just like they went from assaulting soldiers returning from Vietnam to compulsively thanking everyone for their service, maybe they’ll be all woke and friendly next? Too bad it takes so little for them to flip-flop back again, so you can’t really trust it.


We’re talking about different halves. The regex \w+\s+ matches "The " (“The” followed by a space), not “The MCU”.
Let’s not pretend that the allies liked the US before either. The US has been side-eyed by all of the developed world since at least the W. Bush era. It’s been more of a “that dude is a bully, but smile and nod and he’ll hopefully steal someone else’s lunch money instead of ours, and maybe Russia will think we’re friends and not steal our lunch money either”. Now he’s teaming up with Russia and going after everyone’s lunch money.


Why do we replace the commas again with new lines?
Consider this two-line output:
$ echo 'a\nb'
a
b
$
We convert the newlines to commas. Now there is a comma at the end of the last line as well, and because of no newline, the next prompt is at the end of the output:
$ echo 'a\nb' | tr '\n' ,
a,b,$
Substituting only the last comma ( means end of line) allows us to get the output we expected:
$ echo 'a\nb' | tr '\n' , | sed 's/,$/\n/'
a,b
$
Or is there a way to combine them
These two commands have equivalent output:
tr '\n' ',' | tr ';' ','
tr '\n;' ',,'
What tr does is take a list of characters in parameter 1 and converts them to the equivalent position character in parameter 2. There’s a little more to it (it supports ranges, for example), but this will do the job. To learn more you can run man tr to get the documentation for it.
I tried
What \w+\s+ Says About
\w+\s+ matches “at least one word character and then at least one whitespace character”, and that’s not what you want. “The MCU” is one or more word characters, then a space, and then one or more word characters again, and that second part you’re not matching at all. In this case, you’re probably better off making a negative matching group where you make sure you don’t match across separators. What [^,;]+ Says About would match anything that’s not a comma or semicolon, for instance.
The other problem with regex is that every implementation does things differently. For example, sed would interpret that plus as a literal +, so for sed syntax you’d need to use \+ instead. It also does not support \w and \s, and whether to use ( or \( for a literal parenthesis also varies between implementations. I often switch to Perl if I need to do some more complex regex shenanigans.
If you can’t install a dedicated tool like yq but don’t mind creating a standalone script, python would be able to do this out of the box on pretty much any computer, calculator or toaster you can get your hands on in 2026:
#! /usr/bin/env python3
import yaml
import sys
def parse_yaml(filename):
with open(filename) as fd:
return yaml.safe_load(fd)
def get_leaf_nodes(data_iterable):
output = []
for v in data_iterable:
if isinstance(v, dict):
output += get_leaf_nodes(v.values())
elif isinstance(v, list):
output += get_leaf_nodes(v)
else:
output.append(v)
return output
print(",".join(get_leaf_nodes(parse_yaml(sys.argv[1]))))
$ /tmp/foo.py /tmp/foo.txt
Harry potter,Perfect Blue,Jurassic world,Jurassic Park,Jedi,Star wars,The clone wars,MCU,Gumball,Flapjack,Steven Universe,Stars vs. the forces of Evil,Wordgril,Flapjack
This takes the first argument on the command line, parses it as yaml, finds all leaf nodes recursively, and prints a comma-separated list of the results.
If you’re feeling a little old school (and some might say masochistic), you could so a similar crude parser with a perl oneliner. This would be more efficient compute wise, but it’s a bit of an acquired taste readability wise:
$ perl -ne 'chomp; push @a, $1 if /^\s*-\s*(.*[^:\s])\s*$/; END{print join(",", @a), "\n"}' /tmp/foo.txt
Harry potter,Perfect Blue,Jurassic world,Jurassic Park,Jedi,Star wars,The clone wars,MCU,Gumball,Flapjack,Steven Universe,Stars vs. the forces of Evil,Wordgril,Flapjack
Here perl -n makes perl look at each line individually, chomp strips off the trailing newline, we match for /^\s*-\s*(.*[^:\s])\s*$/ (a string starting with a dash and ending with something not a colon) and append the content of the matching parenthesis to an implicitly declared array @a. Then we add an END{} block which will be executed after all lines are parsed, where we print the array joined on ,.
If you wanted a somewhat cruder approach using basically ubiquitous tools, you could do something like this:
$ grep '^ *-' /tmp/foo.txt | grep -v ': *$' | sed 's/ *- //' | tr '\n' ',' | sed s'/,$/\n/'
Harry potter,Perfect Blue,Jurassic world,Jurassic Park,Jedi,Star wars,The clone wars,MCU,Gumball ,Flapjack,Steven Universe,Stars vs. the forces of Evil,Wordgril,Flapjack
Here I’m first using grep '^ *-' to get all lines starting with any amount of whitespace and a leading dash, then piping that to grep -v ': *$' to remove anything with a colon at the end (including those with whitespace after the colon), then using tr '\n' ',' to replace all newlines with commas, and then sed s'/,$/\n/' to replace the trailing comma with a newline again (although sed is finicky across platforms wrt newlines, so you may want to just replace it with an empty string instead).
The above is hardly an efficient approach, but it does the job.
If you can stick to valid YAML like your example is, you can use a reasonably short yq command to get a comma-separated string of all scalar values:
$ yq -r '[.. | scalars] | join(",")' /tmp/foo.txt
Harry potter,Perfect Blue,Jurassic world,Jurassic Park,Jedi,Star wars,The clone wars,MCU,Gumball,Flapjack,Steven Universe,Stars vs. the forces of Evil,Wordgril,Flapjack
.. goes down the tree recursively, scalars filters out only scalar values, [] around those two makes them an array, and piping it all to join(",") makes it into a comma-separated string.
Your description is too vague to really get a good answer. In general, if you’re doing complex string manipulation, you’ll use a full-fledged programming language with regex support, like Python, Perl or Awk, possibly piped into each other and/or other tools like Sed or Cut. I can’t be more specific than that without a more specific description where you describe the actual data and criteria.
Are you starting with the first or second example? Why do the prefix numbers change between examples? How do you tell text and title/subtitle apart?


Yes it was. But as far as I remember, they tried to migrate to Windows and gave up?


That’s the answer right there. They’re voting for her because they like that she’s lining her own pockets.


In my country it meant I was able to vote, buy alcohol and get a driver’s license. I was never interested in alcohol, but I did get a driver’s license a few months later. I didn’t feel that different, but my parents liked that I could ship stuff around for them. I indulged in some voting, too.


I’d be surprised if there aren’t candidates more hateful and racist on the primary ballot.
Grocery store apples in Seattle are actually pretty good, and the above statement still holds true.


I don’t know this bill specifically, but bills have a lot of weird unrelated shit tacked onto them. Sometimes that stuff is state-specific stuff. There have been lots of cases where senators have opposed a bill but changed their tune after something specifically for their state was added. They can then brag about these wins during primaries.
Oddly, they designed a brand new one, instead of just using the 1959 version.


I don’t know the situation in Maine, but being a deciding vote usually means you get a lot of concessions. It’s quite possible Maine residents get what they want from her via these concessions.
They’re not allowed to see actual purchase data, so all they have is “this person looked at a humidifier and may or may not have bought one”. So they’re plastering you with humidifier ads in case you still haven’t pulled the trigger, or in case you did buy one but returned it.
I just replaced the keyboard on a T490s. It took about 90 screws and removal if the motherboard, but went fine. Other models are a lot easier, but this one has the keyboard below the top cover. I replaced it with a $40 off-brand keyboard which seems surprisingly okay, but if I knew about all the screws I probably would have bought a whole top cover like Lenovo wants you to. Don’t think this would have been feasible on most other brands.