Table 39 Arguments for the Get Regular Expression From StringVar Method

Table 39 arguments for the get regular expression

This preview shows page 95 - 98 out of 334 pages.

Table 39. Arguments for the Get Regular Expression From StringVar Method Argument Description regexp A regular expression that you describe as a literal or as a variable.
Image of page 95
Siebel eScript Language Reference Version 8.1, Rev. A Methods Reference String Methods 96 Usage without Setting the Global Attribute If you use the Get Regular Expression From StringVar method with the g global attribute not set on the regular expression, then this usage is the same as with the Get Regular Expression From String method. For more information, see “Usage Without Setting the Global Attribute” on page 201 and “Get Regular Expression from String Method” on page 200 . Usage with Setting the Global Attribute If you use the Get Regular Expression From StringVar method, and if you set the g global attribute on the regular expression, and if this method finds a match, then it does the following: Returns element 0 of the return array as the first text in the string that matches the primary pattern of the regular expression. Returns each subsequent element of the return array as the next text in the string that matches the primary pattern of the regular expression, and that starts after the last character of the previous match. It does not return any matches that overlap other matches. For example, assume the following is true: The primary pattern of the regular expression is a.. (the letter a followed by any two characters). The string is abacadda. In this situation the return array includes the following: aba add It does not include aca. NOTE: If you set the g global attribute on the regular expression, then usage for the Get Regular Expression From StringVar method is very different than usage for the Get Regular Expression From String method. Example 1 The following example uses the Get Regular Expression From StringVar method with a regular expression whose global attribute is not set: function fn () { var myString = new String("Better internet"); var myRE = new RegExp(/(.).(.er)/i); var results = myString.match(myRE); var resultmsg = ""; for(var i =0; i < results.length; i++) { resultmsg = resultmsg + "return[" + i + "] = " + results[i] + "\n"; } TheApplication().RaiseErrorText(resultmsg); } fn (); This example provides the following output:
Image of page 96
Methods Reference String Methods Siebel eScript Language Reference Version 8.1, Rev. A 97 return[0] = etter \\First text that contains primary pattern ...er (any three \\characters followed by "er") return[1] = e \\First text that matches the first subpattern (.) (any single \\character) in the first text that matches the primary pattern return[2] = ter \\First text that matches the second subpattern (.er) (any single \\character followed by "er") in the first text that matches \\the primary pattern Example 2 The following example uses the Get Regular Expression From StringVar method with a regular expression whose global attribute is set. The method returns matches of the primary pattern of the regular expression that do not overlap: function fn () { var str = "ttttot tto"; var pat = new RegExp("t.t", "g"); var rtn = str.match(pat); var resultmsg = ""; for(var i =0; i < rtn.length; i++) {
Image of page 97
Image of page 98

You've reached the end of your free preview.

Want to read all 334 pages?

  • Summer '16
  • Oracle
  • Type system, Siebel, Siebel eScript

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors