Question: I need to find a regular expression, that ignores certain characters for usage in the bib2bib tool.
For example: I need to find any occurence of the word "muller". But also a string like
 ''Hello, my name is Michael M\"uller, how are you?''
or
 ''There is M\"{u}ller''

should be found.

Edit: I need this to work not only for "muller" but dynamically for every word.

Answer: 
If you want to remove things like `\"` and `\"{` and `}`, you will have to preprocess your input file with a tool like `sed` before feeding it into `bib2bib`. 

Example:

```
 sed -e 's/\\"\{\|\\"\|\}// input.bib > input.bib.preprocessed

```

Or to specifically convert things like `\"{u}` into `u`:

```
 sed -e 's/\\"{\(.\)}/\1/' -e 's/\\"//' input.bib > input.bib.preprocessed

```
A fully portable solution could look like:

```sh
n='
';printf %s\\n muller wright dummy >/tmp/patterns
tr '[:lower:][:upper:]' '[:upper:][:lower:]' </tmp/patterns |
paste '-d\n\n' - /tmp/patterns |
sed "N;s/./\\$n&/;:ul$n s/\(\n\)\(.\)\(.*\n\)\(.\)/\2\4\1\3/;tul"'
       s/\n//g;s/../[{}\\"]*[&]/g'

```

The output from that last `sed` looks like:

```sh
[{}\"]*[mM][{}\"]*[uU][{}\"]*[lL][{}\"]*[lL][{}\"]*[eE][{}\"]*[rR]
[{}\"]*[wW][{}\"]*[rR][{}\"]*[iI][{}\"]*[gG][{}\"]*[hH][{}\"]*[tT]
[{}\"]*[Dd][{}\"]*[uU][{}\"]*[Mm][{}\"]*[mM][{}\"]*[Yy]

```

It would depend on the contents of *patterns* being only alphanumeric characters. If *patterns* contained, for example, either of `[]` it would require further testing to ensure that the square brackets were placed correctly each within their respective bracket expressions. 

In any case, based on the example in question:

```sh
[{}\"]*[mM][{}\"]*[uU][{}\"]*[lL][{}\"]*[lL][{}\"]*[eE][{}\"]*[rR]

```

...is a regexp that will match a line containing any of *`muller`* or *`Muller`* or *`M"ulL\\\{"er`*.

With GNU `sed` you can handle the case conversions within `sed` itself, so:

```sh
sed -E 's/([[:upper:]]?)([[:lower:]]?)/\1\L\1\2\U\2/g' patterns

```

...prints...

```sh
mMuUlLlLeErR
wWrRiIgGhHtT
DduUMmmMYy

```

...fully fleshed out, you can get the same behavior as the previous `tr|paste|sed` combination *(except that, this way, the aforementioned square-bracket problem is handled correctly)* with just GNU `sed` like:

```sh
sed -E '
    s/([[:lower:]]?)([[:upper:]]?)/\1\U\1\2\L\2/g
    s/[[:alpha:]]{2}|./[{}\\"]*[&]/g
' </tmp/patterns

```