Find words also with a string in it

Find words also with a string in it

2
NewbieNewbie
2

    May 08, 2011#1

    Hi,

    my english isn't so good. So it's really hard for me to search in this forum for my problem.

    I want to search for words which could also have some strings.
    Example: find highlight, but also h&lnkighlight, high&lnklight

    Next step, search this differents expressions and replace these with a new one.
    Example: find highlight, but also h&lnkighlight, high&lnklight
    replace highlight with Highway, and replace also h&lnkighlight, high&lnklight with Highway

    I hope you understand my simple problem and somebody can help me.
    I wish ultraedit would have more examples in the online help.

    Best regards,

    phantom

    6,675585
    Grand MasterGrand Master
    6,675585

      May 08, 2011#2

      Normally a regular expression search can be used for finding strings with various content. But in your case there is a big problem because &lnk can exist anywhere inside the word highlight and that makes it impossible to find all variations with a simple regular expression expression.

      The best idea I have is to use the Perl regular expression engine and enter all possible variations in a big OR expression. So the search string would be

      highlight|&lnkhighlight|h&lnkighlight|hi&lnkghlight|hig&lnkhlight|high&lnklight|highl&lnkight|highli&lnkght|highlig&lnkht|highligh&lnkt|highlight&lnk

      It is possible to search with Perl regular expression engine for [&ghiklnt]{9,13}\> which means:

      Find a string with any character in the square brackets, ending at end of a word, with a minimum length of 9 and a maximum length of 13 characters.

      If there is surely no occurrence of &lnkhighlight, the search string could be changed to \<h[&ghiklnt]{8,12}\> to further restrict the search to find only words starting with letter H.

      But both of these general search strings can nevertheless also find other words with correct length and consisting only of the letters in the square brackets.

      To reduce the number of found strings to 9 or 13 characters, the Perl regular expression search string [&ghiklnt]{13}\>|\<highlight\> could be used, but false found strings are nevertheless possible.

      2
      NewbieNewbie
      2

        May 08, 2011#3

        Thanks for your effort. I hoped that it would be possible to exlude or ignore a character or a string in a search request.

        236
        MasterMaster
        236

          May 10, 2011#4

          Another option would be to search for

          Code: Select all

          h(?:&lnk)?i(?:&lnk)?g(?:&lnk)?h(?:&lnk)?l(?:&lnk)?i(?:&lnk)?g(?:&lnk)?h(?:&lnk)?t