Struct RegularExpression
This abstracts a ABB Regular exprssion. Use this instead of strings to avoid formatting errors.
Namespace: ABB.Robotics.Controllers
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public struct RegularExpression
Constructors
RegularExpression(String)
Creates the regular expression on the supplied string. The string MUST be the expression from the beginning.
Declaration
public RegularExpression(string expression)
Parameters
Type | Name | Description |
---|---|---|
System.String | expression | The expression. |
Methods
Equals(RegularExpression)
Compares two objects and returns true if the objects are considered equal.
Declaration
public bool Equals(RegularExpression exp)
Parameters
Type | Name | Description |
---|---|---|
RegularExpression | exp | The object to compare with. |
Returns
Type | Description |
---|---|
System.Boolean | True if the objects are considered equal. |
Equals(Object)
Compares two objects and returns true if the objects are considered equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with. |
Returns
Type | Description |
---|---|
System.Boolean | True if the objects are considered equal. |
Overrides
GetHashCode()
Gets the hashcode of the regular expression.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code. |
Overrides
MatchAll()
Matches all symbols
Declaration
public static RegularExpression MatchAll()
Returns
Type | Description |
---|---|
RegularExpression | New regular expression. |
MatchAny(String)
Creates a regular expression that matches any char in the supplied set.
Declaration
public static RegularExpression MatchAny(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to match. |
Returns
Type | Description |
---|---|
RegularExpression | New regular exrepsssion. |
MatchAny(String, Boolean)
Creates a regular expression that matches any char in the supplied set.
Declaration
public static RegularExpression MatchAny(string text, bool inText)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to match. |
System.Boolean | inText | True to match any charachter in the text. |
Returns
Type | Description |
---|---|
RegularExpression | New regular exrepsssion. |
MatchBeginsWith(String)
Creates a regular expression that starts with the supplied text.
Declaration
public static RegularExpression MatchBeginsWith(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to match. |
Returns
Type | Description |
---|---|
RegularExpression | New regular exrepsssion. |
MatchExact(String)
Creates a regular expression that matches the supplied string exact.
Declaration
public static RegularExpression MatchExact(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to match. |
Returns
Type | Description |
---|---|
RegularExpression | New regular exrepsssion. |
ToString()
Returns the string representation of the regular expression.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The regular expression. |
Overrides
Operators
Addition(RegularExpression, RegularExpression)
Adds two regular expressions into a third expression.
Declaration
public static RegularExpression operator +(RegularExpression exp1, RegularExpression exp2)
Parameters
Type | Name | Description |
---|---|---|
RegularExpression | exp1 | Expression 1. |
RegularExpression | exp2 | Expression 2. |
Returns
Type | Description |
---|---|
RegularExpression | The sum of the two expressions. |
Equality(RegularExpression, RegularExpression)
Compares two expressions for equlity.
Declaration
public static bool operator ==(RegularExpression exp1, RegularExpression exp2)
Parameters
Type | Name | Description |
---|---|---|
RegularExpression | exp1 | expression 1 |
RegularExpression | exp2 | expression 2 |
Returns
Type | Description |
---|---|
System.Boolean | true if the expressions are equal |
Explicit(RegularExpression to String)
"Casts" the expression object to a string object.
Declaration
public static explicit operator string (RegularExpression exp)
Parameters
Type | Name | Description |
---|---|---|
RegularExpression | exp | The expression to cast. |
Returns
Type | Description |
---|---|
System.String | The string representation of the expression. |
Inequality(RegularExpression, RegularExpression)
Compares two expressions for un-equlity.
Declaration
public static bool operator !=(RegularExpression exp1, RegularExpression exp2)
Parameters
Type | Name | Description |
---|---|---|
RegularExpression | exp1 | expression 1 |
RegularExpression | exp2 | expression 2 |
Returns
Type | Description |
---|---|
System.Boolean | true if the expressions are unequal |