Description
In the following example, we want to extract all strings matched
[0-9]+(a sequence of digits),
and print them one per line.
|
| Raw Input
|
| Desired Output
| number 123 number 45 number
number 6 another 7890 more 13579
no numbers in this line
2468086 last 1248163264 no more
|
| 123
45
6
7890
13579
2468086
1248163264
|
|
Script and Comments
Script1 [ 1] s/^[^0-9]*([0-9]+)/\1\n/
[ 2] /\n/!d
[ 3] P
[ 4] D
| |
Script2 [ 1] s/^[^0-9]*([0-9]+)/\1\n/
[ 2] /\n/P
[ 3] D
| |