Where to prepare regular expressions for MERGADO? At regex101.com

When creating regular expressions for MERGADO, you may find the regex101.com site useful to help you test the regex. Here are some tips I use:

1. Set up a MERGADO-like environment.

  • check Python in the left column under FLAVOR
  • in the REGEX FLAGS section, you can modify the behavior of how the regular expression should be evaluated

    Note: for convenient testing, I recommend setting up FLAGS g and m.
    image

2. Try substitution

  • if a regular expression matches some text, you can try replacing it with something else, similar to how the Find and Replace rule works in MERGADO. So you can try this rule beforehand at regex101.com and then just transfer the data to MERGADO. :wink:
  • Examples:

3. Send the link to the regex to a friend

  • just use the keyboard shortcut Ctrl+S or click on the link to save:
    image
  • And then you can easily copy the address to your regex to the clipboard:

    and you can send the link to someone right away. :email:

4. Check your regular expression on a larger sample of data

  • It is a good idea to put as large a sample of data as possible in the TEST STRING field so that you can check the regular expression ideally in all cases that may occur.

  • For example, if you are creating a variable from an element in MERGADO, export all the input values to a CSV on the Elements page, and then copy the entire column of values from that CSV (or at least a few dozen values) into the TEST STRING field.
    The procedure in more detail:

    1. export the input values of a specific element from MERGADO to CSV:

    2. open the CSV in some program, e.g. Calc/Excel/Numbers and copy the column with the values:
      image

    3. inserting it into regex101.com and detecting if the regular expression passes all values:

And how do you form regular expressions? :slight_smile: Post your tips in the comments below that can help others easily create regular expressions and use them in MERGADO.