Q:

sed - extract word beetwen two words in a single row without space

I need to extract one word beetwen two words in a single row without space.
For Example, i have this file web.xml :
<connection-url>jdbc:jtds:sqlserver://sql2012:1433/AAA_1</connection-url>
<connection-url>jdbc:jtds:sqlserver://sql2012:1433/BBB_1</connection-url>
<connection-url>jdbc:jtds:sqlserver://sql2012:1433/CCC_2</connection-url>

I need extract AAA_1 , BBB_1 and CCC_2, because they stay in the middle of 1433/ and </connection-url>

A:

Through sed,
$ sed 's~.*1433/\([^<]*\)</connection-url>.*~\1~' file
AAA_1
BBB_1
CCC_2

Through grep,
$ grep -oP '1433\/\K[^><]*' file
AAA_1
BBB_1
CCC_2

