Here it is. Tiny, but gets the job done. And that's what perl is for. a regex with lookbehind stuffed into split. No problem sir!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -e ' | |
$_="<item1>, <item2>, <item3>, <item4 , item5 ,foo>"; | |
print split(/(?<=>)\s*,\s*/), "\n"; | |
' |
No hay comentarios:
Publicar un comentario