import rerx = r"(?:\b|(?<=_))goel(?=\b|_)"s="aakash_goel"print(re.findall(rx,s))
Standard input is empty
['goel']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!