I have miRNA sequences where the 3' adapter is flanked with 12N(random) UMI sequence+RT primer+Universal adapter.

I have tried using regex function in UMI tools but I am not sure if it will work because of the sequence pattern I have.

Please let me know if I have any chance of processing it with UMI tools.

```
Bold - 3' Adapter  ||   Italics - RT primer   ||  In between both of them -UMI Sequence ||  After RT primer UNiversal adapter.
NGGGGTGTGACAATGGTGTTT**AACTGTAGGCACCATCAAT**ATACCCTATGCT*AGATCGGAAGAGCACACGTCT*GAA
NTCTGACATGTGTGCG**AACTGTAGGCACCATCAAT**ACGACGACCCTA*AGATCGGAAGAGCACACGTCT*GAACTCCA
```
You could trim the RT-primer and all sequence to the end of the read, using `bbduk.sh literal=AGATCGGAAGAGCACACGTCT ktrim=r k=15 minlen=0` option. That would ensure that your UMI's will now be at the 3-end most end. Then you should be able to use the `--3prime` option from `umi_tools`.

Final solution based on thread below:

    bbduk.sh in=your_file.fq.gz out=stdout.fq literal=AGATCGGAAGAGCACACGTCT ktrim=r k=15 minlen=0 | umi_tools extract --extract-method=string --bc-pattern=NNNNNNNNNNNN --3-prime | bbduk.sh in=stdin.fq out=final.fq literal=AACTGTAGGCACCATCAAT ktrim=r k=15 minlen=0