Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Daniele Futtorovic Newsgroups: comp.lang.java.programmer Subject: Re: Because ramine plugging comp.programming with spam.... Date: Wed, 27 Nov 2019 20:09:30 +0100 Organization: A noiseless patient Spider Lines: 38 Message-ID: References: <64859ebd-4194-4b36-ae6b-80135a519db2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 27 Nov 2019 19:09:34 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="1a34bfece7ffa5bb79379bfefecdf4e5"; logging-data="494"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+2zSI+9ctYSBzpHR/gZIl" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 Cancel-Lock: sha1:ntrAebQgH5D4GXXcSJylyxx+evI= In-Reply-To: <64859ebd-4194-4b36-ae6b-80135a519db2@googlegroups.com> X-Antivirus-Status: Clean Content-Language: en-US X-Antivirus: AVG (VPS 191126-2, 11/26/2019), Outbound message Xref: csiph.com comp.lang.java.programmer:39193 On 2019-11-27 14:32, chad altenburg wrote: > This is sort of Java related. > > This is about searching for a word in a Java using regex. > > I have the word "AlarmService". > > 1)searching for "alarm" produces "AlarmService" > > 2)searching for "alarmS" produces nothing > > 3)searching for "AlarmS" produces "AlarmService" > > The question is how come having a lowercase in "a" in 1 produces the entire word > while the lowercase "a" in 2 doesn't? Ie, I have to change it uppercase in order to get the correct result. > > This is about searching for a word in a Java using regex. Is it really? > I'm using the Java IDE that comes with Android Studio for Windows 10. I'm using IntelliJ. So not the same IDE, but perhaps the same mechanism. IntelliJ has a nifty function when it comes to searching for items (files, classes, etc.). If your input string is all lowercase, it returns any item that starts with that input, ignoring case. But if you start mixing uppercase in the input, it performs a sort of extremely useful camel-case search, in which "AS" and "AlS" will match both "AlarmService" and "AluminumSwingSet", but "AlSe" will match only "AlarmService" (of the two, at least). Which doesn't have anything to do with regexes, per se. -- DF.