Simplex represents the most basic expressions consisting in only two symbols :
- * - Ignore everything
- # - Match everything
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"]
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
|
| Parameters: |
| $pattern : | The pattern with which this Simplex will be created. |
|
Creates a new Simplex concept with the given $pattern.
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
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
Returns this Simplex concept pattern.
$expr = Simplex.create("#test*")
print $expr.getPattern
-- the result is --
#test*