search for ? in all fields

Help
2008-09-16
2013-05-28
  • Knut Krüger

    Knut Krüger - 2008-09-16

    Hi to all, does anybody knows the command to search for ? in one or all fields

    f.e title contains "Sch?brunn"

    Regards Knut

     
    • Richard Karnesky

      If you mean the literal question mark character, you should precede it with a slash:  "Sch\?brunn"

      If you mean how to search for a pattern that has any single character in that position, use a period: "Sch.brunn"

      If you are trying to use this to search for multiple extended character possibilities, search for 0 or more extra characters with a period+asterisk:
      "Sch.*brunn"

      --Rick

       
    • Knut Krüger

      Knut Krüger - 2008-09-16

      Hi Rick
      thank you the first question is solved with \?

      Is it possible to search for ? in words but not at the end

      f.e I would like to find
      Eine bisher ?bersehene Erw?hnung der Tigerpferde aus dem Altertum
      but not
      Transitive inference in animals: Reasoning or conditioned associations?

      Knut

       
      • Richard Karnesky

        Sure.  Search for:
          "\?.*[^\?]$"
        Separating this, we are looking for a literal question mark (\?) followed by zero or more characters (.*) followed by a single non question mark ([^\?]) that occurs at the end of the string ($).

        There are numerous regular expression references available for more information.

        Best,

        Rick

         
    • Matthias Steffens

      Hi Knut, Rick gave you already good advice.

      You may also want to have a look at:

      http://wiki.refbase.net/index.php/Searching#Using_metacharacters_to_form_complex_queries

      and the linked tutorials & intros to regular expressions.

      Learning a little bit about regular expressions is time well worth spent since they're generally useful (e.g. almost any good text editor has support for basic regular expressions, and so does MySQL). Personally, I don't know how I could live without them. :-)

      Matthias

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks