Question: first, I want to upload .xlxs and .csv file in node.js. then I want to read this file, edit this file, and also want to save this file in mongoose schema in the database.
and I am new in node.js and I want to learn node backend
please guide me, how I can do this and is this possible?

Answer: 
If letters are duplicated, you can try something like this

```
for w in text.split():
    if len(w) %2 != 0:
        print(w)
        continue
    if w[0::2] == w[1::2]:
        print(w[0::2])
        continue
    print(w)

```
I am using a mixed approach: build the pattern and substitution in a for loop, then applying regex. The regexes applied go from e.g. words of 8x2=16 letters down to 3.

```
import re
text = 'and assesses oouurr rreeffoorrmmeedd tteeaacchhiinngg in the classroom'
wrd_len = [9,8,7,6,5,4,3,2]
for l in wrd_len:
    sub = '\\' + '\\'.join(map(str,range(1,l+1)))
    pattern = '([a-z])\\' + '([a-z])\\'.join(map(str,range(1,l+1)))
    text = re.sub(pattern, sub , text)
text
#and assesses our reformed teaching in the classroom

```

For example, the regex for 3-letter words becomes:

```
re.sub('([a-z])\1([a-z])\2([a-z])\3', '\1\2\3', text)

```

As a side note, I could not get those backslashes right with raw strings, and I am actually going to use [a-zA-Z].