Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ STRING="(test)(te st) tesst. test test test test [teest] [teseeet]"
- $ echo "$STRING" | perl -lne ' @out = ();
- /\( (.+?) \(/ and push @out, $1;
- /.+\( \K(.+?) \. (.+?)(?= \[)/ and push @out, $1, $2;
- /(\[.+?\[)/ and push @out, $1;
- /.+\[ (....)/ and push @out, $1;
- print join " ", @out
- '
- [teest] [
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement