[QScintilla] Search Whole Word matches Only on regular expression symbol

Han Lun Tan hltan at altera.com
Fri Oct 11 02:57:51 BST 2013


Thanks for response :)
I will mark this down as one of our limitation for find feature :)

Thanks.


-----Original Message-----
From: qscintilla-bounces at riverbankcomputing.com [mailto:qscintilla-bounces at riverbankcomputing.com] On Behalf Of Baz Walter
Sent: Friday, October 11, 2013 1:07 AM
To: qscintilla at riverbankcomputing.com
Subject: Re: [QScintilla] Search Whole Word matches Only on regular expression symbol

On 10/10/13 01:29, Han Lun Tan wrote:
> Hi,
>
> I using FindFirst to do search, turn on wo = true to search for whole word matches only.
> However, I found some bug as below text
>
> Known that I have turned on ONLY wo = true for whole word matches.
> Given I have text as below, I search for "$test" It returns nothing.
> ($test)
> ($test)
> ($test)
>
> If I change my search text to "test", I can find all the 3 lines results.
>
> Is this a bug ? Any workaround?

It's not a bug: by default, "$" won't be counted as a word character.
However, it is possible to change the set of characters that Scintilla treats as word-characters (and also what is treated as whitespace and punctuation).

At the moment, I don't think QScintilla provides a way to do this through the high-level api. (It is possible to re-implement the QSciLexer wordCharacters function, but I think this will only directly affect auto-completion). Instead, you could try setting the word-characters through the low-level api, i.e.:

     SendScintilla(SCI_SETWORDCHARS, characters)

Note that setting the word-characters in this way will change the behaviour of Scintilla in several ways, not just finding text. For instance, double-clicking a word to select it will include any new characters you have added.

For more info, see the Scintilla docs:

     http://www.scintilla.org/ScintillaDoc.html#SCI_SETWORDCHARS

And also the QsciScintillaBase docs:


http://pyqt.sourceforge.net/Docs/QScintilla2/classQsciScintillaBase.html#pub-methods

--
Regards
Baz Walter
_______________________________________________
QScintilla mailing list
QScintilla at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/qscintilla


Confidentiality Notice.
This message may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any use, disclosure, dissemination, distribution,  or copying  of this message, or any attachments, is strictly prohibited.  If you have received this message in error, please advise the sender by reply e-mail, and delete the message and any attachments.  Thank you.



More information about the QScintilla mailing list