Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How find words that match criteria

    Help wanted · · · – – – · · ·
    2
    4
    127
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MineJOT1 1
      MineJOT1 1 last edited by

      I have a long list of words whereof I want to find specific words that are

      1. for example 5 characters long
      2. has some letters that I know and some that I don’t know
      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @MineJOT1 1 last edited by

        @minejot1-1

        So the use of “word” implies that you define a word appropriately. A common definition is characters from the English set A,B,C,…,Z or lowercase, the digits 0,1,2,…9, and the underscore character. If this is acceptable then for your first question an expression to search on would be:

        find: \b\w{5}\b
        mode: regular expression

        When coupled with your second condition, I might go with a search expression like this one, for the word letter with some letters you don’t know:

        find: (?=\b\w{5}\b)(?i)l.tt.r
        mode: regular expression

        The . would represent the letters you don’t know.

        MineJOT1 1 1 Reply Last reply Reply Quote 0
        • MineJOT1 1
          MineJOT1 1 @Alan Kilborn last edited by

          @alan-kilborn
          Hey, that works. Thanks!

          Alan Kilborn 1 Reply Last reply Reply Quote 0
          • Alan Kilborn
            Alan Kilborn @MineJOT1 1 last edited by Alan Kilborn

            @minejot1-1 said in How find words that match criteria:

            that works

            Hmm. I swear that I have early dementia.
            When I tested it out I used a 5-letter-word.
            But when I posted, for some reason I changed it to a 6-letter example (“letter”), which would not work the way I wrote it before.

            So maybe change my prior example to:

            find: (?=\b\w{6}\b)(?i)l.tt.r
            mode: regular expression

            I think you can see how you might adjust it to use any specific number of characters…

            1 Reply Last reply Reply Quote 2
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors