H Lecture Notes - Lecture 10: Regular Expression
Document Summary
Your task is to find out whether s is a valid regex or not. The first line contains integer t, the number of test cases. The next t lines contains the string s. Print "true" or "false" for each test case without quotes. # incorrect regex in python - hacker rank solution. # incorrect regex in python - hacker rank solution start import re; N = int(input()) for _ in range(n): try: re. compile(input()) # incorrect regex in python hacker rank solution end. # incorrect regex in python - hacker rank solution end. A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a pattern. Regular expressions are widely used in unix world. The python module re provides full support for perl-like regular expressions in python.