Advertisement
Guest User

regexp

a guest
Oct 19th, 2021
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. re="\(([^()]|(?R))*\)"
  2. array=(
  3.     "[macdoll(マコ(・c_・))]shutter chance!!(ラブライブ)"
  4.     "[しろむじ(ん坊主)]まる限定。((G)えでぃしょん)"
  5.     "[PASTEL WING(如月あいす)]アイスフレンド(嫁)03(ガール(仮))"
  6.     "x(1)x((2)2)(3(33))x((4((44))))x"
  7. )
  8.  
  9. for s in "${array[@]}"
  10. do
  11.     echo $s
  12.     echo ---
  13.     echo $s | grep -Po $re
  14.     echo
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement