Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #43583

Re: A case insensitive substring search?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c++
Subject Re: A case insensitive substring search?
Date Tue, 28 Jun 2016 23:48:24 +0100
Organization A noiseless patient Spider
Lines 17
Message-ID <877fd9gcav.fsf@bsb.me.uk> (permalink)
References <C6mdnaL0a8umRu_KnZ2dnUU7-cHNnZ2d@giganews.com>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="11106"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PuFkFscSqI++MopuYsPeEH8Z/VxPLkA4="
Cancel-Lock sha1:mIPPuFfHxxn+7qZa+ZieC/GWVfc= sha1:GDk7q8xyHuuvMtP9lWcVpzVkP8s=
X-BSB-Auth 1.178ba80c17d9a32f4929.20160628234824BST.877fd9gcav.fsf@bsb.me.uk
Xref csiph.com comp.lang.c++:43583

Show key headers only | View raw


James Moe <jimoeDESPAM@sohnen-moe.com> writes:

>   A case insensitive substring search: How hard can it be?.
>   I searched for it. There are lots of case insensitive string searches,
> but very few case insensitive substring searches. Nothing that I could
> understand.
>   I came up with the following. It seemed that search_n() was perfect
> for a substring search; I just had to supply an appropriate comparison
> function. which is where I stalled.

You need search, not search_n.  And if you are using modern C++ you can
pass a lambda for the comparison function so there is no need for an
extra named function (though that's not a big deal).

<snip>
-- 
Ben.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

A case insensitive substring search? James Moe <jimoeDESPAM@sohnen-moe.com> - 2016-06-28 13:16 -0700
  Re: A case insensitive substring search? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-06-28 23:48 +0100
    Re: A case insensitive substring search? James Moe <jimoeDESPAM@sohnen-moe.com> - 2016-06-28 22:25 -0700
      Re: A case insensitive substring search? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-06-29 10:56 +0100
        Re: A case insensitive substring search? Öö Tiib <ootiib@hot.ee> - 2016-06-29 04:19 -0700
      Re: A case insensitive substring search? James Moe <jimoeDESPAM@sohnen-moe.com> - 2016-06-29 10:48 -0700
  Re: A case insensitive substring search? Nobody <nobody@nowhere.invalid> - 2016-06-29 00:39 +0100
    Re: A case insensitive substring search? Öö Tiib <ootiib@hot.ee> - 2016-06-29 06:22 -0700
      Re: A case insensitive substring search? Ralf Goertz <me@myprovider.invalid> - 2016-06-29 17:16 +0200
        Re: A case insensitive substring search? Öö Tiib <ootiib@hot.ee> - 2016-07-01 01:46 -0700
    Re: A case insensitive substring search? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-06-29 21:32 +0200
    Re: A case insensitive substring search? Nobody <nobody@nowhere.invalid> - 2016-07-01 07:53 +0100

csiph-web