How to search in strings
I want to search for the text "geograf" in Java strings. Following
occurences should be found
"geograf"
"blabla geograf blabla"
"GEOgraf"
but not
// "geograf"
/* geograf */
dcs.geograf.GeografLibrary
Thanks in advance for your help.
Tom
Please sign in to leave a comment.
Hi,
Structural Search: "$a$", a.text="geograf", whole words only
Please, note that case sensitive option = true will be much-much faster.
Thomas Singer (MoTJ) wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Seems not to work, it just finds "geograf", but not " geograf ".
Tom
Correction: with "Whole Words Only" option checked, it seems to work.
But this is strange, because "Whole Words Only" suggests to be a filter,
which might reduce the found occurences, not to find more than without it.
Tom
BTW, how to search for "..." instead of "geograf" (conditions the same)?
Tom
text = .\.\.\.., whole words only=false
Thomas Singer (MoTJ) wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Yes, the option set is shorthand for complex reg exp around the text
constraint .*
b(?:)
b
Yet another presentation of the option could be 2 radio buttons like:
'match the text' and 'match the text on the word boundary'
Thomas Singer (MoTJ) wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
To be honest, this would not help me further, because "word boundary" is
unclear to me.
Tom
Ahm, do you think, this is intuitive? Why not have the possibility to
either enter plain text or regular expression text? Why not add a menu
button right beside the regular expression text input field for easy
entering such strange regular expressions (BTW, this was requested ages
ago)?
Tom
The text of the constraint is actually whole words in larger construction.
Thomas Singer (MoTJ) wrote:
>> Yet another presentation of the option could be 2 radio buttons like:
>> 'match the text' and 'match the text on the word boundary'
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Hi,
Most of used text fragments (as of my information) are plain english
words so there were no difference at all for the user.
However, adding checkbox (two, actually, since there are two such
fields) on how to treat the content of the field will be usable in some
(rare?) cases.
Thomas Singer (MoTJ) wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"