XLib


Download
Installation
X-VBA Home

Array
=AverageHigh
=AverageLow
=CountUnique
=IsInArray
=Large
=Reverse
=Small
=Sort
=SumHigh
=SumLow

Color
=Hex2Hsl
=Hex2Rgb
=Hsl2Hex
=Hsl2Rgb
=Rgb2Hex
=Rgb2Hsl
=Rgb2Hsv

DateTime
=DaysOfMonth
=MonthName2
=Quarter
=TimeConverter
=WeekOfMonth
=WeekdayName2

Environment
=ComputerName
=OS
=UserDomain
=UserName

File
=CountFiles
=CountFilesAndFolders
=CountFolders
=CurrentFilePath
=FileCreationTime
=FileDrive
=FileExtension
=FileFolder
=FileLastModifiedTime
=FileName
=FileSize
=FileType
=GetActivePath
=GetActivePathAndName
=GetFileNameByNumber
=PathJoin
=PathSeparator
=ReadFile
=WriteFile

Math
=Ceil
=Floor
=InterpolateNumber
=InterpolatePercent
=Max
=Min
=ModFloat

Meta
=XlibCredits
=XlibDocumentation
=XlibVersion

Network
=Http
=ParseHtmlString
=SimpleHttp

Random
=BigRandBetween
=RandBetween
=RandBetweens
=RandBool
=RandomRange
=RandomSample

Regex
=RegexReplace
=RegexSearch
=RegexTest

StringManipulation
=CamelCase
=Capitalize
=CompanyCase
=CountLowercaseCharacters
=CountUppercaseCharacters
=CountWords
=DedentText
=EliteCase
=Formatter
=InSplit
=IndentText
=KebabCase
=LeftFind
=LeftSearch
=LeftSplit
=RemoveCharacters
=Repeat
=ReverseText
=ReverseWords
=RightFind
=RightSearch
=RightSplit
=ScrambleCase
=ShortenText
=SplitText
=Substr
=SubstrFind
=SubstrSearch
=TextJoin
=TrimChar
=TrimLeft
=TrimRight
=Zfill

StringMetrics
=Damerau
=Hamming
=Levenshtein

Utilities
=BigDec2Hex
=BigHex
=Dec2Hex
=Hex2Dec
=HideText
=HtmlEscape
=HtmlUnescape
=JavaScript
=Jsonify
=Len2
=SpeakText
=UuidFour

Validators
=CreditCardName
=FormatCreditCard
=IsCreditCard
=IsEmail
=IsIPFour
=IsMacAddress
=IsPhone
=IsUrl

Regex Module

This module contains a set of functions for performing Regular Expressions, which are a type of string pattern matching. For more info on Regular Expression Pattern matching, please check "https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference"


=RegexReplace(string1, stringPattern, replacementString, [globalFlag], [ignoreCaseFlag], [multilineFlag])

This function takes a string that we will perform the Regular Expression on, a Regular Expression string pattern, and a string that we will replace if the pattern is found, and returns a new string with the replacement string in place of the pattern. This function also contains optional arguments for various Regular Expression flags.

Arguments

{String}: string1   ➔   is the string that the regex will be performed on

{String}: stringPattern   ➔   is the regex pattern

{String}: replacementString   ➔   is a string that will be replaced if the pattern is found

[(Optional) {Boolean}: globalFlag]   ➔   is a boolean value that if set TRUE will perform a global search

[(Optional) {Boolean}: ignoreCaseFlag]   ➔   is a boolean value that if set TRUE will perform a case insensitive search

[(Optional) {Boolean}: multilineFlag]   ➔   is a boolean value that if set TRUE will perform a mulitline search


Returns

{String}: Returns a new string with the replaced string values


Examples

  • =RegexReplace("Hello World","[W][a-z]{4}", "VBA") -> "Hello VBA"

=RegexSearch(string1, stringPattern, [globalFlag], [ignoreCaseFlag], [multilineFlag])

This function takes a string that we will perform the Regular Expression on and a Regular Expression string pattern, and returns the first value of the matched string. This function also contains optional arguments for various Regular Expression flags.

Arguments

{String}: string1   ➔   is the string that the regex will be performed on

{String}: stringPattern   ➔   is the regex pattern

[(Optional) {Boolean}: globalFlag]   ➔   is a boolean value that if set TRUE will perform a global search

[(Optional) {Boolean}: ignoreCaseFlag]   ➔   is a boolean value that if set TRUE will perform a case insensitive search

[(Optional) {Boolean}: multilineFlag]   ➔   is a boolean value that if set TRUE will perform a mulitline search


Returns

{String}: Returns a string of the regex value that is found


Examples

  • =RegexSearch("Hello World","[a-z]{2}\s[W]") -> "lo W";

=RegexTest(string1, stringPattern, [globalFlag], [ignoreCaseFlag], [multilineFlag])

This function takes a string that we will perform the Regular Expression on and a Regular Expression string pattern, and returns TRUE if the pattern is found in the string. This function also contains optional arguments for various Regular Expression flags.

Arguments

{String}: string1   ➔   is the string that the regex will be performed on

{String}: stringPattern   ➔   is the regex pattern

[(Optional) {Boolean}: globalFlag]   ➔   is a boolean value that if set TRUE will perform a global search

[(Optional) {Boolean}: ignoreCaseFlag]   ➔   is a boolean value that if set TRUE will perform a case insensitive search

[(Optional) {Boolean}: multilineFlag]   ➔   is a boolean value that if set TRUE will perform a mulitline search


Returns

{Boolean}: Returns TRUE if the regex value that is found, or FALSE if it isn't


Examples

  • =RegexTest("Hello World","[a-z]{2}\s[W]") -> TRUE;