Say we have a file called "Hello World: The easiest program" and its name is saved in a variable called "title".
I want to match this with glob pattern matching, but remove the colon. In other words, I want it to match "Hello World The easiest program"
I found out you can do this by using the following:
${/:/|${title}|}
It works, but I don't understand why.
I know that "|" is OR, so to me it looks like it matches "${/:/}" or "${${title}}" or "${}", none of which look like they're removing the colon.
So my question is: How/why does the glob pattern matching expression above remove colons from a title?
Edit: I should mention the shell I'm using is the Steam ROM Manager. And it seems I was mistaken and it's not a glob expression, but a Steam ROM Parser function variable that optionally uses glob syntax (in place of the default regex syntax).Thanks Steeldiver and ilkkachu!
${/:/|${title}|}doesn't work for my current shells (bashandzsh)${/(\s?\[.*?\]\s?)/|${/(\s?\(.*?\)\s?)/|${/:/|${title}|}|}It first takes the title, replaces colons with nothing, then takes the result and replaces the first thing that matches\s?\(.*?\)\s?and replaces it with nothing and then takes the result again and replaces the first thing that matches\s?\[.*?\]\s?and replaces it with nothing