• Resolved doublehead73

    (@doublehead73)


    Hi!
    I have a couple copies of pro so far. Glad to support amazing work.
    Question: Can I query a wildcard?

    For example, on the woocommerce product pages there is a general text saying”
    Leg Opening: 16” (or any other size)
    I want to query Leg Opening: *** (being wildcard characters)
    and replace with:
    Leg Opening: ***<br>
    Pictured on a 5’10” model

    Is this possible?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Marios Alexandrou

    (@marios-alexandrou)

    Wildcards are supported via regular expressions which allows you to write fairly intricate rules to match just about anything. The syntax for regular expressions can be tricky though so you may need to experiment a bit.

    Thread Starter doublehead73

    (@doublehead73)

    Right! Actually right after I wrote this a programmer friend came over and gave me a lesson regex. We got this working perfectly on textpad with Regex enabled for replace.. but when i add the exact same code to the site, it makes all pages go blank:

    Search: Leg Opening: [0-9][0-9].
    Replace: $& <br>Pictured on a 5’10” model

    Any idea what I might be doing wrong, when it works in textpad?
    Thanks!

    Thread Starter doublehead73

    (@doublehead73)

    Hmm strangely, anything I type give a blank page if regex is checked. Strange.

    Plugin Author Marios Alexandrou

    (@marios-alexandrou)

    You need to start and end the regex with a forward slash i.e. /. If that doesn’t help, paste the rule in and I’ll check it out.

    Thread Starter doublehead73

    (@doublehead73)

    Totally helped. The find appears to get the range. But for some reason the replace query does not function at all.
    This functions fine on textpad without the slashes. I really appreciate the help, doing my best to read and learn more about regedit. Time to take a class maybe.

    find:
    /Leg Opening: [0-9][0-9]./
    Replace:
    /$& br>Pictured on a 5’10” model/

    or I also tried (for replace)
    $& br>Pictured on a 5’10” model

    Result is:
    /$& br>Pictured on a 5’10” model/#8243;

    • This reply was modified 7 years, 11 months ago by doublehead73.
    • This reply was modified 7 years, 11 months ago by doublehead73.
    • This reply was modified 7 years, 11 months ago by doublehead73.
    Plugin Author Marios Alexandrou

    (@marios-alexandrou)

    I would start by finding and replacing a small piece and then expanding the find to include more and more. That way you can identify where the issue is. For example, can you use the regex to replace just the word “Leg”, then “Leg Opening”, then “Leg Opening: “, etc.

    Thread Starter doublehead73

    (@doublehead73)

    I actually got that far, it just doesn’t recognize the call to pass (instead of replace) the searched text as it should. Perhaps there is another way to call it in. I did read about using /1 or something to call in the search results from the brackets.. but this was got the whole phrase in textedit.

    Maybe Ill get a regex expert for an hour to coach me on it.
    Cheers!
    -Shaun

    Thread Starter doublehead73

    (@doublehead73)

    Solved!

    1: /Leg Opening: \d[“-”]/

    2: $0 <br>Pictured on a 5’10” model

    Plugin Author Marios Alexandrou

    (@marios-alexandrou)

    That’s great!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Wildcards’ is closed to new replies.