Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Enable wildcard matching.

Component Version macOS Windows Linux Server iOS SDK
CURL 5.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionWildCardMatch"; curl; Value )   More


Parameter Description Example
curl The CURL session handle. $curl
Value The new setting. Can be 1 (on) or 0 (off). 1


Returns OK or error.


Enable wildcard matching.
Set parameter to 1 if you want to transfer multiple files according to a file name pattern. The pattern can be specified as part of the OptionURL option, using an fnmatch-like pattern (Shell Pattern Matching) in the last part of URL (file name).

By default, libcurl uses its internal wildcard matching implementation.

A brief introduction of its syntax follows:

  • - ASTERISK*.txt (for all txt's from the root directory)


Question mark matches any (exactly one) character.


The left bracket opens a bracket expression. The question mark and asterisk have no special meaning in a bracket expression. Each bracket expression ends by the right bracket and matches exactly one character. Some examples follow:

[a-zA-Z0-9] or [f-gF-G] - character interval
[abc] - character enumeration
[^abc] or [!abc] - negation
[[:name:]] class expression. Supported classes are alnum,lower, space, alpha, digit, print, upper, blank, graph, xdigit.
[][-!^] - special case - matches only '-', ']', '[', '!' or '^'. These characters have no special purpose.
[\[\]\\] - escape syntax. Matches '[', ']' or '´.

Using the rules above, a file name pattern can be constructed:[a-z[:upper:]\\].jpeg

This feature is only supported for FTP download.

See also WILDCARDMATCH option in CURL manual.


Enable wildcard match:

MBS( "CURL.SetOptionWildCardMatch"; $curl; 1 )

Download several files via FTP:

Set Variable [$curl; Value:MBS("CURL.New")]
#Set URL with wildcard match
Set Variable [$result; Value:MBS("CURL.SetOptionURL"; $curl; CURL Test::URL)]
#Set folder where to put files
Set Variable [$result; Value:MBS("CURL.SetBatchDestinationPath"; $curl; CURL Test::DestPath)]
Set Variable [$result; Value:MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password)]
Set Variable [$result; Value:MBS("CURL.SetOptionUserName"; $curl; CURL Test::Name)]
#enable wildcard match
Set Variable [$result; Value:MBS("CURL.SetOptionWildCardMatch"; $curl; 1)]
#download them all
Set Field [CURL Test::Result; MBS("CURL.Perform"; $curl)]
#check results
Set Field [CURL Test::debug; MBS("CURL.GetDebugMessages"; $curl)]
Set Field [CURL Test::FileNames; MBS("CURL.GetBatchFileNames"; $curl)]
Set Variable [$result; Value:MBS("CURL.Release"; $curl)]

See also

Example Databases

Created 8th July 2015, last changed 19th April 2020

CURL.SetOptionWebSocketOptions - CURL.SetOptionXOAuth2Bearer