str = '[2019-07-29 09:48:11,928] @hr.com [2] [AM] WARN'p str[/\[[^\]\[]*\].*?\[([^\]\[]*)\]/m, 1]
Standard input is empty
"2"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!