Consider the output of java -jar plantuml.jar -language
:
;type
;26
abstract
actor
............................
;color
;147
AliceBlue
AntiqueWhite
Aqua
Aquamarine
............................
Wheat
White
WhiteSmoke
Yellow
YellowGreen
;EOF
I need to extract colors from this text without surrounding strings. I have read several articles and Q&As and did not found answer. Here i found the most suitable answer.
$ java -jar plantuml.jar -language | sed -n '/\;color/,/\n\n/{/color/!{/\n\n/!p}}'
;147
AliceBlue
AntiqueWhite
Aqua
Aquamarine
Azure
Beige
Bisque
....................
Teal
Thistle
Tomato
Turquoise
Violet
Wheat
White
WhiteSmoke
Yellow
YellowGreen
;EOF
There is a small nuance: ;147
could be any other value and EOF
could be changed at any time to something other. I tried sed -n '/\;color\s*\;\d*/,/\n\n/
, but it returns nothing. Please help me to achieve the next result:
AliceBlue
AntiqueWhite
Aqua
Aquamarine
Azure
Beige
Bisque
....................
Teal
Thistle
Tomato
Turquoise
Violet
Wheat
White
WhiteSmoke
Yellow
YellowGreen