mn8 Language Reference | Index    

Simplex

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

Simplex represents the most basic expressions consisting in only two symbols :

Usage

This expamle get email addresses from specified string.

            $str = "my email addresses is mailto:jon@email.com \
                         but you can use also the mailto:jon@yahoo.com address"
            $expr = Simplex.create("*mailto:# *")
            print $str.select($expr)
            ["jon@email.com"; "jon@yahoo.com"]

Version: 0.1
Authors:Remus Pereni (http://neuro.nolimits.ro)
Location:
Inherits: Concept, Expression

Constructor List

create (String $pattern)
top

Method List

Logicalcontains (String $str)
SeriesgetMatches (String $str)
StringgetPattern
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI
Methods inherited from: Expression
contains, contains, getMatches, getMatches, getPattern, matches, matches, setPattern

Detailed Constructor Info

create (String $pattern)
Parameters:
$pattern :The pattern with which this Simplex will be created.

Creates a new Simplex concept with the given $pattern.

top

Detailed Method Info

contains (String $str)
Parameters:
$str :Any string.
Returns: Logical

Returns true if this concept contains the given string, false otherwise.

            $expr = Simplex.create("*is*")
            print $expr.contains("this is a test")
            -- the result is --
            true
            

top
getMatches (String $str)
Parameters:
$str :Any string.
Returns: Series

Returns a series which contains all matches between this concept and the given string.

            $expr = Simplex.create("#test*")
            print $expr.getMatches("this is a test, a simplex matches test.")
            -- the result is --
            this is a 
            , a simplex matches
            

top
getPattern
Returns: String

Returns this Simplex concept pattern.

            $expr = Simplex.create("#test*")
            print $expr.getPattern
            -- the result is --
            #test*
            

top