Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: input foo, output '[F|f][O|o][O|o]'?
Since the topic is Regular Expressions, I will take the opportunity to recommend the O'Reilly book, "Mastering Regular Expressions" by Jeffrey Freidl. Even if you only work through the first few chapters (it provides examples for you to play with and learn), it will be worth the investment.
I am a very happy "student" (disciple, even) of Jeffrey Freidl's writing, and I have many O'Reilly books in my library.
Alex Satrapa
On 02/07/2013, at 3:59, "TJ Luoma" <luomat@xxxxxxxxx> wrote:
>
> 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