Ganesh Pal writes: > why is re.search failing in the below case ??
Your pattern, '... level-based: [prev 0 , now 1]', matches a literal string '--- level-based: ' followed by 'p', 'r', 'e', 'v', ' ', '0', ..., or '1', none of which is the '[' found in your text at that position. Are you sure you need a regexp? If you are, make your pattern r'... \[prev 0 , now 1\]'. The 'r' is not a typo. -- https://mail.python.org/mailman/listinfo/python-list