I have a couple of String varieties as shown below:
78:24207 PERF keytouchListAction ProtocolSelect 04.00 : 1502876877199 1502876879180
or
78:27247 PERF create tab state : 1502876879180
I am searching for a regular expression to remove the numbers at the beginning of the string 78:24207
.
To achieve something like this:
PERF keytouchListAction ProtocolSelect 04.00 : 1502876877199 1502876879180
or
PERF create tab state : 1502876879180
and then if the string contains two numbers after the :
, only take the first number:
PERF keytouchListAction ProtocolSelect 04.00 : 1502876877199 1502876879180
becomes:
PERF keytouchListAction ProtocolSelect 04.00 : 1502876877199
I attempted using this replace(/^\d+\.\s*/, '');
for the initial pattern but it didn't work.
and this expression for the second problem replace(\:.*)
but no change occurred in my string.
Any suggestions on what I may be doing incorrectly?