I am using Notepad++. I am having some entries as below:
001:0> class Item
002:1> def initialize(id)
003:2> @id = id
004:2> end
Now is there anyway to quickly remove those 001:0>,002:1>... in one shot and get them as below:
class Item
def initialize(id)
@id = id
end
Thanks
Use the
Replacedialog, and check the boxRegular Expressionsat the bottom.Find:
RegexBuddy’s Explanation tree:
or after a line break character) «^»
backreference number 1 «(\d+?:\d+?>)»
expanding as needed (lazy) «+?»
expanding as needed (lazy) «+?»
backreference number 2 «(.*)»
back as needed (greedy) «*»
Replace:
This replaces the entire match with the content of capture group
2(see above)Click
Replace AllNote that the regular expression for the find portion will also match numbers in the format
00:0>,0000:00>,00000000:00000000>, and so forth. If that won’t work for you, change the regular expression to: