I want to write regex for django’s model’s charField. That regex contains all letters and last character contains “https://stackoverflow.com/”.

Eg: “sequences/”

I return regex as follows,

Model.objects.filter(location_path__iregex=r'^[a-zA-Z]/$')

It is not showing filter data.
demo data for location_path is [‘sequences/’, ‘abc/xyz/’, ‘abc/aaaa/aaa’, ‘pqr/’]

I want to filter data like ‘sequences/’, ‘pqr/’ which contains any character from a-z and field end with “https://stackoverflow.com/”

Please give me the proper regex pattern and syntax

You need to add + after the character class, so that it would match one or more letters,

r'^[a-zA-Z]+/$'