In 4.2 final
Searching with the regular expressions
\b. or \<. jumps to the beginning of a word, unless the
cursor is already in a word, in which case it finds the
next character within the word.
This makes it impossible to replace characters only at
the beginning of a word.
For instance:
search on
\<.
replace with BeanShell snippet
_0.toLowerCase()
should force the first character of every word to be
lower case. However, it actually forces \*every\*
character of every word to be lower case.
Submitted | abgrover - 2005-10-12 17:50:09 | Assigned | |
---|---|---|---|
Priority | 4 | Labels | search and replace |
Status | open | Group | normal bug |
Resolution | None |
2005-10-13 03:39:00 vampire0 |
Logged In: YES |
---|---|
2008-03-02 21:44:33 rschwenn |
Logged In: YES |
2012-01-19 19:41:43 ezust |
- **milestone**: 101608 --> 101607 |
2012-01-19 20:15:50 sjakob |
I don't think this is a bug. I see 2 issues with Alan G's approach:
|
2012-01-21 12:21:24 rschwenn |
Just tried again:
|
2012-01-22 10:55:23 boise |
As noted, \b matches word boundaries, i.e. both the beginning and end of a "word".
So \b. will indeed match the first letter of any word, but also the first whitespace
character (and any other non-word character such as the dot after a sentence) AFTER
every word. (Though that doen't matter if you just want to upper-case it). |
2012-04-22 14:21:04 jarekczek |
Search and replace design does not allow to fix this without significant interface
extension. SearchMatcher class has findNext method which always starts from 0 index.
It does not allow to supply a different index. If findNext method has no access to
the previous characters, it is not able to perform a word boundary search correctly.
So I don't expect this to be fixed soon.
|
2012-04-22 14:21:04 jarekczek |
- **milestone**: 101607 --> normal bug |