/ Published in: Bash

I pipe in a title, like say \"Best of Both Worlds, Part 2\" though this, it works fine, but if I omit the space between \"Part\" and the number, I get unexpected behavior:\r\n\r\n- If it\'s a single digit, like \"part2\", it works fine, giving me \" (2)\"\r\n- If it\'s more than one digit, it chops off the first digit, so \"part123\" becomes \" (23)\"\r\n\r\n[Sigh. Snipplr is adding the backslashes here, not me. Please ignore them.]
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
sed -e 's/ *-\{0,1\},\{0,1\} *[Pp][Aa]\{0,1\}[Rr]\{0,1\}[Tt].\{0,1\} *\([0-9]\{1,\}\) *$/ (\1)/'
Comments
