Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

input foo, output '[F|f][O|o][O|o]'?




Before I reinvent the wheel, I thought I'd ask if someone already had (or knew of) a way to take a string of characters and output a 'case insensitive' regex version.

For example, if I input 'CrashPlan' I'd want to get out [C|c][R|r][A|a][S|s][H|h][P|p][L|l][A|a][N|n]

(Input will usually be ASCII letters, with an occasional number and perhaps the occasional '-' or '_' but doesn't need to handle anything more complex than that.)

I tried Google but found it pretty impossible to make a good query for something like this.

TjL



Messages sorted by: Reverse Date, Date, Thread, Author