mn8 Language Reference | Index    

Expression

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

Description

The abstract concept has common super concept for regular and simple expression. All expression concept has to inherited all methods of this concept.

Usage

Version: 0.1
Authors:Remus Pereni (http://neuro.nolimits.ro)
Location:
Inherits: Concept
Inherited by: Regexp, Simplex

Constructor List

create (String $pattern)
create
top

Method List

Logicalcontains (String $str)
static Logicalcontains (String $pattern, String $str)
static SeriesgetMatches (String $pattern, String $str)
SeriesgetMatches (String $str)
StringgetPattern
static Logicalmatches (String $pattern, String $str)
Logicalmatches (String $str)
setPattern (String $pattern)
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

Detailed Constructor Info

create (String $pattern)
Parameters:
$pattern :Any pattern.

Creates a new Expression with the given $pattern.

top
create

Creates a new empty Expression.

top

Detailed Method Info

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

Returns true if this expression contains the string given as parameter, false otherwise.

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

top
static contains (String $pattern, String $str)
Parameters:
$pattern :Any pattern.
$str :Any string.
Returns: Logical

Returns true if this expression contains the given string with the specified pattern, false otherwise.

            print Simplex.contains("*is*", "this is a test")
            -- the result is --
            true
            

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

Returns a series which represents all matches between this Expression and the given string with the specified pattern.

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

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

Returns a series which represents all matches between this Expression 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 Expression's pattern if there is any.

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

top
static matches (String $pattern, String $str)
Parameters:
$pattern :Any pattern.
$str :Any string.
Returns: Logical

Returns true if this Expression and the given srting matches by the specified pattern, false otherwise.

            print Simplex.getMatches("#test*", "this is a test, a simplex matches test.")
            -- the result is --
            true
            

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

Returns true if this Expression and the given string matches, false otherwise.

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

top
setPattern (String $pattern)
Parameters:
$pattern :Any pattern
Returns:

Sets this Expression's pattern to the pattern given as parameter.

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

top