How to extract the value between the key using RegEx with Python

  python, python-3.x, regex, split

I have text like

"abababba"

I want to extract the characters as a list between a.
For the above text, I am expecting output like

[b, b, bb]

I have used,

re.split(r'^a(.*?)a$', data)

But it doesn’t work.

Source: Python-3x Questions

LEAVE A COMMENT