Search the FirstSpirit Knowledge Base
Hello,
Below is my regular expression which works on https://regex101.com
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>
TEST String:
<iframe id="kmsembed-0_po9vsvpf" width="608" height="432" src="https://test.staging.video.tracker.org/embed/secure/iframe/entryId/0_po9vsvpf/uiConfId/23448525"
class="kmsembed" allowfullscreen webkitallowfullscreen mozAllowFullScreen allow="autoplay *; fullscreen *;
encrypted-media *" frameborder="0" title="Player"></iframe>
How to change the REGEX to FS 5.2.2109 Rules area.
<MATCHES regex=" ">
<PROPERTY name="VALUE" source="ptEmbedVideoID"/>
</MATCHES>
Thank you.
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
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
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.
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