Reputation: 163
If I have the following dataset in Sublime, how I can get the following expected output using regex operation.
Given dataset:
1,11111111
123,22222222
12,88888888
Expected output:
11111111
22222222
88888888
So, basically I would like to get rid of everything before comma in the comma itself.
What would be the regex expression to run in sublime?
Upvotes: 2
Views: 4160
Reputation: 37367
Although you could do it by finding index of last comma and taking substring from your orginal string, which I'd recommend, here isd pattern to use (?<=,).++
.
(?=,)
- assert that after current position there's comma.
.++
- match as much characters as possible, except new line \n
(since you want everything after the comma), unless you are using single line mode in regex.
Upvotes: 4
Reputation: 472
Doing a ctrl + f
, entering \d+,
, pressing alt + enter
and then return
, you should get what you want.
Hope this help.
Upvotes: 3