Eclipse Regex Search for beginning and end of line not working
eclipse, regex
Solution
`^` and `$` are zero-width anchors as you said, therefore they will not match anything by themselves. You need to use something with the anchors in order to match anything in your file.
Problem
This is a small question, but it has been nagging me for a while. When I do a Find or Find/Replace in Eclipse and I use `^` or `$` and check the Regular Expressions box, I always get a message: `String Not Found` I don't understand why. I know about the `CTRL+SPACE` content assist feature and even when I select `^` from the list, it does not work. I was looking at this question, Regex to match start of line and end of line for quick find and replace, but it is not working for me. Other regex searches like `^.` or `;$` work fine. I see that `^` and `$` are anchor characters, and do not match a string per se, but these characters seem to work in other editors. EDIT: For example, I want to convert a list of data into an SQL in clause. From: ``` 1 2 3 Hi I need to quote these! ``` To: ``` '1', '2', '3', 'Hi', 'I need to quote these!', ```