Bug 68889 - [find/replace] RegExp doesn't match the Caret character '^'
Summary: [find/replace] RegExp doesn't match the Caret character '^'
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 minor with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 403063 404900 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-29 12:57 EDT by Dean Schulze CLA
Modified: 2019-09-11 16:50 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Schulze CLA 2004-06-29 12:57:31 EDT
Attempting to do a regexp search and replace (Ctrl-F) fails to match the '^' 
character for beginning of a line.

This is 3.0RC3.
Comment 1 Dani Megert CLA 2004-06-30 04:52:54 EDT
I opened a file using R3.0 which has

p

searched for ^p and it found p

Note: regex must be enabled
Comment 2 Dean Schulze CLA 2004-06-30 11:57:46 EDT
It fails if I search for the beginning of the line only (i.e. when commenting 
out lines):

  Find:          ^
  Replace with:  //

It works if I add a character to the search like ^p, but shouldn't I be able to 
search for the beginning of a line only?

I should have been more specific in the original bug report, though.
Comment 3 Dean Schulze CLA 2004-06-30 12:01:39 EDT
Here's a work around, but it's more complex than searching for ^:

  Find:           ^(.)
  Replace with:  //  $1


The search works if it includes any character, but you have to use a group 
preserve the first character.  It would be much simpler if we could just search 
for ^.
Comment 4 Dani Megert CLA 2004-07-05 04:22:54 EDT
agree
Comment 5 Dani Megert CLA 2008-01-17 12:20:35 EST
See corresponding bug 215670 against Platform Search.
Comment 6 Dani Megert CLA 2010-04-07 11:10:20 EDT
*** Bug 308340 has been marked as a duplicate of this bug. ***
Comment 7 Didier Loiseau CLA 2010-04-07 11:43:51 EDT
I am not sure Big 308340 is exactly the same bug. In that one, the search matches some text, but the highlighted text is wrong (it selects one more character) and I suspect it only happens with windows EOLs. Also, the replace feature does not work, whatever the regexp (this might be correct, as it would remove the \n from a \r\n, which must not be allowed).
Comment 8 Markus Keller CLA 2010-04-08 09:59:25 EDT
Bug 308340 is indeed something different.
Comment 9 Markus Keller CLA 2012-05-11 14:10:09 EDT
Probably related to bug 80661.
Comment 10 Dani Megert CLA 2013-03-14 11:35:25 EDT
*** Bug 403063 has been marked as a duplicate of this bug. ***
Comment 11 Dani Megert CLA 2013-04-04 10:10:34 EDT
*** Bug 404900 has been marked as a duplicate of this bug. ***
Comment 12 Eclipse Genie CLA 2019-09-11 16:50:11 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.