regular expression in formapi

rodigz
rodigz Member
edited July 20, 2021 in TeamSite #1
Hi,

I have perl regular expresion and I want to have it same function in formapi. How will I do it?
($summary_text =~ /\<a+\s+\href+\="/)

Comments

  • Hi,

    you can use regular expressions in JavaScript&colon;

    var zeichen = "...my text ...";
    var x = /(.*)\s{2,20}(\w+)\s{2,20)/;
    x.exec(zeichen);

    var name = RegExp.$1;
    var text = RegExp.$2;


    Ciao,
    Jens
  • thanks Jens for your reply but can you elaborate your code.
  • The regex before doesn't make sense for zeichen=... my text .., it's only an example for using regex in Javascript&colon;

    here is a working one

    var zeichen = "my regextext";
    var x = /(.*)\s+(.*)/;
    x.exec(zeichen);
    var name = RegExp.$1;
    var text = RegExp.$2;

    where name = my and text = regextext

    the same in perl is:
    $zeichen = "my regextext";
    $zeichen =~ /(.*)\s+(.*)/;
    $name = $1;
    $text = $2;


    --Jens
  • thanks Jen..

    where can I read manual of formapi regular expression.
  • there isn't a manual for regex in formapi.
    it's a javascript functionality.
    I am sure you can find some docs in www
    I have only some german sites like selfhtml.teamone.de
  • A good quick-reference site is: www.devguru.com

    They have sections on Javascript, ASP, VBScript, CSS, and others.

    This site wouldn't be real helpful if you've never used these languages, but as a quick-reference its great.

    Jonathon
    Independent Interwoven Contractor
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs