# Specify prefix with regular expression in scanpy.read\_10x\_mtx()

**URL:** <https://discourse.scverse.org/t/specify-prefix-with-regular-expression-in-scanpy-read-10x-mtx/1789>\
**Category:** scanpy\
**Created:** [October 2, 2023, 4:56pm UTC](https://discourse.scverse.org/t/specify-prefix-with-regular-expression-in-scanpy-read-10x-mtx/1789 "2023-10-02T16:56:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hmnzo5gy](https://avatars.discourse-cdn.com/v4/letter/h/9e8a1a/32.png) [@hmnzo5gy](https://discourse.scverse.org/u/hmnzo5gy)\
**Post date:** [October 2, 2023, 4:56pm UTC](https://discourse.scverse.org/t/specify-prefix-with-regular-expression-in-scanpy-read-10x-mtx/1789/1 "2023-10-02T16:56:21Z")

</div>

The input files have the following name pattern

```auto
'gsm123_sample1_barcodes.tsv.gz'
'gs123_sample1_features.tsv.gz'
'gsm123_sample1_matrix.mtx.gz'

```

Is there a way for me to use regex to specify the prefix pattern ‘text\_text\_’ in the scanpy.read\_10x\_mtx() function to read in the data?
