Zum Hauptinhalt gehen

How to make the the regex workin FS Rules section?

Kommentare

3 Kommentare

  • Zendesk API User
    Author: mbergmann - 8/28/2018 13:27

    Hi Siva,

    as explained here, you have to escape some characters (<, ", &) - > will then also be replaced automatically.

    So in your case it should work using the following expression:

    ...

    <WITH>

    <MATCHES regex="<iframe \s*id=["]([A-Za-z0-9-_]*)["] \s*width=["](\d{3})["] \s*height=["](\d{3})["] \s*src="https:\/\/test\.staging\.video\.tracker\.org\/embed\/secure\/iframe\/entryId\/([0]_[a-zA-Z0-9]{8})\/uiConfId\/(\d{8}["])\s*[^>]+>*<\/iframe>">

    ...

    Michael

    0
  • Zendesk API User
    Author: sivaprasad9394 - 8/28/2018 14:06

    Hello Bergmann,

    Thank you for your time and kind reply.

    RULE:

    <RULES>

        <RULE>

            <WITH>

                <PROPERTY name="body" source="#global"/>

            </WITH>

            <DO>

                <PROPERTY name="VALUE" source="ptEmbedVideoSection"/>

            </DO>

        </RULE>

        <RULE>

            <WITH>

                <MATCHES regex="<iframe \s*id=["]([A-Za-z0-9-_]*)["] \s*width=["](\d{3})["] \s*height=["](\d{3})["] \s*src="https:\/\/test\.staging\.video\.tracker\.org\/embed\/secure\/iframe\/entryId\/([0]_[a-zA-Z0-9]{8})\/uiConfId\/(\d{8}["])\s*[^>]+>*<\/iframe>">

                    <PROPERTY name="VALUE" source="ptEmbedVideoID"/>

                </MATCHES>

            </WITH>

            <DO>

                <VALIDATION scope="SAVE">

                    <PROPERTY name="VALID" source="ptEmbedVideoID"/>

                    <MESSAGE lang="*" text="Please enter a valid BoschTube Embed-ID"/>

                    <MESSAGE lang="DE" text="Bitte geben Sie ein gültiges BoschTube Embed-ID ein."/>

                </VALIDATION>

            </DO>

        </RULE>

    </RULES

    Its not working and always throws this error.

    Thank you.

    0
  • Zendesk API User
    Author: mbergmann - 8/28/2018 14:39

    Hi Siva,

    I tested it locally with the RegEx and it works for me.

    It seems your input starts with a blank - that may be the reason.

    Michael

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.