I am trying to search a .txt file on my computer to delete certain sets of words.
Here is the original text:
Highlight [page 3]: To see how things COULD BE in the future?
Highlight [page 3]: In fact, it’s Core Experience 2: Future Self.
I would like it to read like this:
- To see how things COULD BE in the future?
- In fact, it’s Core Experience 2: Future Self.
I have gone through quite a few forum posts and have gotten close using a REGEX pattern
Problem is, I now can't figure out how to delete what I am finding!
Any insight would be much appreciated.
Well - As fate would have it. I have found the solution. For anyone who might find this useful, this is what I ended up doing.
I don't really understand REGEX, but I found online that part of the issue I was having was that I needed to use a backslash on characters that doubled as REGEX information.
Don't use the Search: Regex, use Search:Replace with Regex. They sound similar, but the first (as shown in your example) lets you capture to groups. The second can just massage the original text, if you want (or capture to groups for immediate replacement).
I didn't thoroughly test the regex, but this should work:
(?m) bit means "search multiple lines," then find the bit you're looking from from the start of the line through the "colon space." Then capture everything after that to the end of the line into $1.
Edit: Our replies crossed :). And yes, you don' need to capture it, you can just leave it off. (I tend to capture everything when I'm writing stuff, for fear I'll want it later and would have to go back and edit to do so :))