Wildcards in searches

  • Advertisement ( why? )
     

    digitl, 30th May 2015 10:49 am

    I would like to be able to search for title="?" (where ? can be any character and any number of characters) and automatically replace all instances with title="xxxx" where xxxx is any string I decide is appropriate.

    Is it possible to use wildcards to do this and, if it is, what should I use?

    • HTML-Kit Support, 30th May 2015 11:53 am

      On 5/30/2015 10:49 AM, digitl wrote:

      I would like to be able to search for title="?" (where ? can be any
      character and any number of characters) and automatically replace all
      instances with title="xxxx" where xxxx is any string I decide is
      appropriate.

      Is it possible to use wildcards to do this and, if it is, what should
      I use?

      Hi,

      You sure can by using regular expressions which is a more advanced (for
      better and worse!) form of wildcards.

      1. From HTML-Kit Tools main menu, select "Edit > Replace > Regex
        (single-line)". You'll then be able to use Ctrl+H shortcut to get to it.

      2. Enter the following search expression:

        title=\"[^\"]+\"

      3. Enter your replace string. Staying with your example, it'd be:

        title="xxxx"

      4. Click "OK" and HTML-Kit will show you before and after text, with
        highlights, so you can decide whether to go ahead and apply the change.

      Hope this helps. If you're new to regular expressions, check out:

      http://regexone.com/

      Chami

      • digitl, 30th May 2015 6:29 pm

        Thank you!