Regex and //i

reading the regex in the xojo help docs i did not see anything about
this //ig for pattern compares.

ex pattern search: /onetwoThreeFour/ig
where “i” means upper or lower , and where “g” means global.

can xojo use the // ?

please advise.

Not that way, but you can set case-sensitivity on two ways. You can set the RegEx.Options.CaseSensitive to true (it’s false by default), or use a switch in the pattern.

(?i)pattern # case-INsensitive
(?-i)pattern # case-sensitive

As for global, you can set Options.ReplaceAllMatches to true if you’re interested in replacements. If you are just interested in matching all occurrences of the pattern, you need to loop through the string yourself.

dim rx as new RegEx
rx.Options.CaseSensitive = true

dim match as RegExMatch = rx.Search( s )
while match isa RegExMatch
  // Do something with the match
  match = rx.Search // This will match the next occurrence
wend

Ahh shucks xojo doesn’t have a global short cut…

But the caseSenitive is cool…

Ok great thx