fork download
  1. str = '[2019-07-29 09:48:11,928] @hr.com [2] [AM] WARN'
  2. p str[/\[[^\]\[]*\].*?\[([^\]\[]*)\]/m, 1]
  3.  
Success #stdin #stdout 0s 6348KB
stdin
Standard input is empty
stdout
"2"