Reputation: 13
I am trying to swap the content beginning from the hyphen in each line to the start of each line. I can find the hyphen with (-.*) But I don't know the regexp for the "Replace with:"
Example of how the code looks right now:
Beet - ½ cup
Strawberry - ½ cup
Mango - ½ cup
Desired Outcome:
- ½ cup Beet
- ½ cup Strawberry
- ½ cup Mango
I appreciate your help. Thanks in advance.
Upvotes: 1
Views: 78
Reputation: 174696
Find what:
^(\S+)\s+(-.*)
OR
^([^-]*)\s+(-.*)
Replace With:
\2 \1
Upvotes: 1