I am trying to delete certain text that appears before /
on every line.
I have something like:
testing.db.com/7fad416d-f2b3-4259-b98d-2449957a3123
testing.db.com/8a8589bf-49e3-4cd7-af15-6753067355c6
and I just want to end up with:
7fad416d-f2b3-4259-b98d-2449957a3123
8a8589bf-49e3-4cd7-af15-6753067355c6
Can anyone help me with a regular expression? Everything I have found is deleting after /
, not before.
Best Answer
Using
cut
:The following suggestions assumes that
/
appears only once in a line :Using
grep
:If you have
/
in all of the lines, you can use these too:Using
bash
parameter expansion:Or
python
:Note that as far as your example is concerned all of the above suggestions are valid.