Hi,
Looking for some help to learn some regex.
I’m a total newbee to regex, so please bear with me..
I work a lot with youtube and youtube transcripts. It seems recently youtube is transitioning it’s transcript layout. Meaning that one can find video’s with the old layout and also with the new layout. I could not find some clear information on this subject from Google or Youtube for that matter.
In the “old” layout, there was an option (clicking the 3 dots) that would reveal an option to turn toggle timestamps. This option seems to be disappearing. It is unclear if this will happen to all youtube channels or not. E.g. the most recent meetup video still has the option to toggle transcript.
As a result, when copying and pasting transcript, one inherently copies the timestamps too.
Strange enough, when pasting (I’ve tried with TBX and with TextEdit.app) what happens is that the timesamps somehow seem to get translated or converted in partly numeric and partly text format.
I’ll try to copy the results below to illustrate.
My question:
Suppose I have timestamps pasted in my text as follows:
14:08
14 minutes, 8 seconds
How would I go about using explode to replace both “14:08” and “14 minutes, 8 seconds” with “nothing”?
Perhaps it might be prudent to do this in two steps, first e.g. replace the timestamps with some text e.g. “replaced”, as this allows then to search for “ replaced” to check if all is good and in then in the second step, substitute “replaced” with ““ (nothing)
Here come the time stamp snippets:
- copy / pasted from TextEdit
so schaut's gerade im Moment aus ich habe hier eben
13:4313 minutes, 43 seconds3 5000er multiplus noch ein 3000er daneben das ist mein allererster gewesen den ich gehabt habe da kann ich jetzt
13:5113 minutes, 51 secondsdann endlich mal das Video machen was ich schon lange versprochen habe zur Einbindung eines Generators iMon System
14:0014 minutesohne victron quadros m kommen jetzt bestimmt Einwende weil ich den Gobel Akku im Moment stehend
14:0814 minutes, 8 secondshabe und der ist natürlich für die 3 5000er multiplus auch zu klein dass ich die entsprechend voll auslasten könnte wobei ich das auch nicht brauch
14:1714 minutes, 17 secondsich habe die 3 5000 eigentlich viel mehr dafür genommen dass ich mein froniio Symo 15 dann irgendwann auch mal offgrd fähig bekomme da brauche ich natürlich
14:2614 minutes, 26 secondsnoch viel mehr Akkukapazität
- copy / pasted from TBX
so schaut’s gerade im Moment aus ich habe hier eben
13:43
13 minutes, 43 seconds
3 5000er multiplus noch ein 3000er daneben das ist mein allererster gewesen den ich gehabt habe da kann ich jetzt
13:51
13 minutes, 51 seconds
dann endlich mal das Video machen was ich schon lange versprochen habe zur Einbindung eines Generators iMon System
14:00
14 minutes
ohne victron quadros m kommen jetzt bestimmt Einwende weil ich den Gobel Akku im Moment stehend
14:08
14 minutes, 8 seconds
habe und der ist natürlich für die 3 5000er multiplus auch zu klein dass ich die entsprechend voll auslasten könnte wobei ich das auch nicht brauch
14:17
14 minutes, 17 seconds
ich habe die 3 5000 eigentlich viel mehr dafür genommen dass ich mein froniio Symo 15 dann irgendwann auch mal offgrd fähig bekomme da brauche ich natürlich
14:26
14 minutes, 26 seconds
noch viel mehr Akkukapazität
For information, here’s a link to the youtube where this textsnippet is copied from.
As always, thanks for helping out!




