Platforms to show: All Mac Windows Linux Cross-Platform

Back to RegExMBS class.

RegExMBS.CompileOptionAnchored as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Force pattern anchoring

(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionAutoCallOut as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Compile automatic callouts

(Read and Write property)

RegExMBS.CompileOptionBSRAnyCRLF as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This option and CompileOptionBSRUnicode (which are mutually exclusive) control what the \R escape sequence matches.

The choice is either to match only CR, LF, or CRLF, or to match any Unicode newline sequence. The default is specified when PCRE is built. It can be overridden from within the pattern, or by setting an option when a compiled pattern is matched.
(Read and Write property)

RegExMBS.CompileOptionBSRUnicode as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This option and CompileOptionBSRAnyCRLF (which are mutually exclusive) control what the \R escape sequence matches.
Example
Var rg As new RegExMBS
rg.CompileOptionUngreedy = false
rg.CompileOptionBSRUnicode = true

Var ts as string = "one" + EndOfLine.UNIX + "test" + chr(&h2028) + "more"

// replace all end lines with #
if rg.Compile("\R+") then

ts = rg.ReplaceAll(ts,"#")

end if

MsgBox ts

The choice is either to match only CR, LF, or CRLF, or to match any Unicode newline sequence. The default is specified when PCRE is built. It can be overridden from within the pattern, or by setting an option when a compiled pattern is matched.
(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionCaseLess as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Do caseless matching
Example
Var r as new RegExMBS
Var searchString as string = "hello"

r.CompileOptionCaseLess=True

if r.Compile(searchString) then

Var s as string="äöü Hello World"

if r.Execute(s,0)>0 then
MsgBox "Found: "+mid(s, r.OffsetCharacters(0)+1, r.OffsetCharacters(1)-r.OffsetCharacters(0))
else
MsgBox "nothing found"
end if

else
MsgBox "failed to compile"
end if

(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionDollarEndOnly as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: $ not to match newline at end

(Read and Write property)

RegExMBS.CompileOptionDotAll as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: . matches anything including endofline
Example
Var r as new RegExMBS
Var searchString as string = "<.+>"

r.CompileOptionDotAll = false // finds only if true

if r.Compile(searchString) then

Var s as string="<Step enable=""True"""+EndOfLine.unix+"id=""93"" name=""Beep""/>"

if r.Execute(s,0)>0 then
MsgBox "Found: "+mid(s, r.OffsetCharacters(0)+1, r.OffsetCharacters(1)-r.OffsetCharacters(0))
else
MsgBox "nothing found"
end if

else
MsgBox "failed to compile"
end if

(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionDuplicateNames as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
If this bit is set, names used to identify capturing subpatterns need not be unique.

This can be helpful for certain types of pattern when it is known that only one instance of the named subpattern can ever be matched. There are more details of named subpatterns below; see also the pcrepattern documentation.
(Read and Write property)

RegExMBS.CompileOptionExtended as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Ignore whitespace and # comments

(Read and Write property)

RegExMBS.CompileOptionFirstLine as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Force matching to be before newline

(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionJavaScriptCompat as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
If this option is set, PCRE's behaviour is changed in some ways so that it is compatible with JavaScript rather than Perl.

The changes are as follows:

(1) A lone closing square bracket in a pattern causes a compile-time error, because this is illegal in JavaScript (by default it is treated as a data character). Thus, the pattern AB]CD becomes illegal when this option is set.

(2) At run time, a back reference to an unset subpattern group matches an empty string (by default this causes the current matching alternative to fail). A pattern such as (\1)(a) succeeds when this option is set (assuming it can find an "a" in the subject), whereas it fails by default, for Perl compatibility.
(Read and Write property)

RegExMBS.CompileOptionMultiline as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: ^ and $ match newlines within data
Example
Var r as RegExMBS
Var n,i,c as Integer
Var s as string

s=ReplaceLineEndings(EditField1.text,EndOfLine.UNIX)

r=new RegExMBS

'r.CompileOptionFirstLine=True
r.CompileOptionMultiline=True

if r.Compile("^....$") then
n=0
do
c=r.Execute(s,n)

if c>0 then
MsgBox r.Substring(0)
n=r.Offset(1)
end if

loop until c=0
end if

(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionNewLineAny as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This option override the default newline definition that was chosen when PCRE was built.

Setting CompileOptionNewLineCR or CompileOptionNewLineLF specifies that a newline is indicated by a single character (CR or LF, respectively). Setting CompileOptionNewLineCRLF specifies that a newline is indicated by the two-character CRLF sequence. Setting CompileOptionNewLineAnyCRLF specifies that any of the three preceding sequences should be recognized. Setting CompileOptionNewLineAny specifies that any Unicode newline sequence should be recognized. The Unicode newline sequences are the three just mentioned, plus the single characters VT (vertical tab, U+000B), FF (formfeed, U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS (paragraph separator, U+2029). The last two are recognized only in UTF-8 mode.
The newline setting in the options word uses three bits that are treated as a number, giving eight possibilities. Currently only six are used (default plus the five values above). This means that if you set more than one newline option, the combination may or may not be sensible. For example, CompileOptionNewLineCR with CompileOptionNewLineLF is equivalent to CompileOptionNewLineCRLF, but other combinations may yield unused numbers and cause an error.

The only time that a line break in a pattern is specially recognized when compiling is when PCRE_EXTENDED is set. CR and LF are whitespace characters, and so are ignored in this mode. Also, an unescaped # outside a character class indicates a comment that lasts until after the next line break sequence. In other circumstances, line break sequences in patterns are treated as literal data.
(Read and Write property)

RegExMBS.CompileOptionNewLineAnyCRLF as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This option override the default newline definition that was chosen when PCRE was built.

See CompileOptionNewLineAny for more details.
(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionNewLineCR as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This option override the default newline definition that was chosen when PCRE was built.

See CompileOptionNewLineAny for more details.
(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionNewLineCRLF as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This option override the default newline definition that was chosen when PCRE was built.

See CompileOptionNewLineAny for more details.
(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionNewLineLF as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This option override the default newline definition that was chosen when PCRE was built.

See CompileOptionNewLineAny for more details.
(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionNoAutoCapture as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Disable numbered capturing parentheses (named ones available)

(Read and Write property)

RegExMBS.CompileOptionNoStartOptimize as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This is an option that acts at matching time; that is, it is really an option for Execute.

If it is set at compile time, it is remembered with the compiled pattern and assumed at matching time.
(Read and Write property)

RegExMBS.CompileOptionNoUTF8Check as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Do not check the pattern for UTF-8 validity.

(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptions as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The internal value of all the compile options.

You can get and set the bits using the CompileOption* Boolean properties.
(Read and Write property)

RegExMBS.CompileOptionUngreedy as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Invert greediness of quantifiers.

Basicly this is about whether to find the next matching item or the last matching item in the whole string.
Matching the next item is always much faster.
(Read and Write property)

Some examples using this property:

RegExMBS.CompileOptionUnicodeCodePoints as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to support unicode code points for character classes.

This option changes the way PCRE processes \B, \b, \D, \d, \S, \s, \W, \w, and some of the POSIX character classes. By default, only ASCII characters are recognized, but if PCRE_UCP is set, Unicode properties are used instead to classify characters. More details are given in the section on generic character types in the pcrepattern page. If you set PCRE_UCP, matching one of the items it affects takes much longer. The option is available only if PCRE has been compiled with Unicode property support.
(Read and Write property)

RegExMBS.CompileOptionUTF8 as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Option for Compile: Run in UTF-8 mode.

(Read and Write property)

Some examples using this property:

RegExMBS.Count as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Regular Expressions MBS RegEx Plugin 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Number of offsets found.
Example
Var r as new RegExMBS
Var searchString as string = ".o"

if r.Compile(searchString) then

Var s as string="äöü Hello World"

if r.Execute(s,0)>0 then
Var lines(-1) as string

lines.Append str(R.Count)+" offset found."
lines.Append "In Bytes:"
lines.Append " Start of matched patern: "+str(R.Offset(0))
lines.Append " End of matched patern: "+str(R.Offset(1))
lines.Append " Length of matched patern: "+str(R.Offset(1)-r.Offset(0))

lines.Append "In Characters:"
lines.Append " Start of matched patern: "+str(R.OffsetCharacters(0))
lines.Append " End of matched patern: "+str(R.OffsetCharacters(1))
lines.Append " Length of matched patern: "+str(R.OffsetCharacters(1)-r.OffsetCharacters(0))

MsgBox Join(lines,EndOfLine)
end if

else
MsgBox "failed to compile"
end if

(Read only property)

The items on this page are in the following plugins: MBS RegEx Plugin.


The biggest plugin in space...