Welcome to Macrobject Community Login | Register | Faq  

    Macrobject Community
  Macrobject Software Knowledge Management and Collaboration Platform
Search    
   

Re: System.Text.Regex Parameters
Started by wasuplee123 at 07-21-2008 3:17 PM. Topic has 1 replies.

Print Search Next Thread »
  07-21-2008, 3:17 PM
wasuplee123 is not online. Last active: 9/9/2008 9:31:45 AM wasuplee123

Top 25 Posts
Joined on 06-04-2008
Posts 8
System.Text.Regex Parameters
Reply Quote
The API shows the following:

regexVar = System.Text.Regex(pattern, options)

I figured out that pattern is a string variable, but what type is options, and what values can it take?


--

Also it would help if the API had type prefixes for function arguments as well...

For Example, these 2 functions:

matchVar = regexVar.Match(theInput)
strVar = strVar.Left(Count)

should be written as:

matchVar = regexVar.Match(strTheInput)
strVar = strVar.Left(intCount)


This would help clarify what argument types the functions take.
   Report 
  07-22-2008, 1:38 AM
Bill is not online. Last active: 12/18/2009 11:43:49 PM Bill

Top 10 Posts
Joined on 06-28-2008
Posts 15
Re: System.Text.Regex Parameters
Reply Quote
The help file is updated accroding to your suggestion, thanks.

// example for System.Text.Regex
// regex options is a string, it can contain options:
//   s: single line
//   m: multiple line
//   i: case insensitive
//   x: ignore white space in pattern

var regex = system.text.regex(pattern, 'si');
var match = regex.match(strInput);
var output = '';

while match.success do
 
  output ~= match.unmatchedValue;
 
  //var matchedValue = match.value;
  var id = match.groupByName('id').value;

  ... ...

  match.nextMatch();
end while

output ~= match.unmatchedValue();

// end example

   Report 
Post
Macrobject Comm... » Developing Tool... » Nuva Language » Re: System.Text.Regex Parameters

Powered by Community Server, by Telligent Systems