Reputation: 18868
I have sample data
| 1 |
| 2 |
| 3 |
I want to remove everything else except numbers, keeping line (\n)
as usually.
Output:
1
2
3
I am bit new to Sublime and Regex. :)
Upvotes: 1
Views: 4055
Reputation: 70750
Based on your sample data, you can use the following.
Find: ^\D+|\D+$
Replace:
This matches the beginning of the string, followed by any character of non-digits (1
or more times) OR any character of non-digits (1
or more times) preceded by the end of the string.
Upvotes: 2
Reputation: 4843
Open the Find Replace in Sublime. You'll search for:
[^\d\n]+
and replace with an empty string.
The Regex matches everything except numbers or newlines
Upvotes: 3