Xano Documentation
Search…
πŸ’‘
Start here
☁️ Your Xano Account
πŸ’²
Special Discount Pricing
πŸ”¨
Troubleshooting
Text Filters
​
Text filters enable you to transform and manipulate text.
  • ​capitalize - Converts the first letter of each word to a capital letter.
  • ​concat - Concatenates two values together.
  • ​contains - Returns whether or not the expression is found.
  • ​ends_with - Returns whether or not the expression is present at the end.
  • ​icontains - Returns whether or not the case-insensitive expression is found.
  • ​iends_with - Returns whether or not the case-insensitive expression is present at the end.
  • ​iindex - Returns the index of the case-insensitive expression or false if it can't be found.
  • ​index - Returns the index of the case-sensitive expression or false if it can't be found.
  • ​istarts_with - Returns whether or not the case-insensitive expression is present at the beginning.
  • ​ltrim - Trim whitespace or other characters from the left side and return the result.
  • querystring_parse - Parses a query string from a URL into its individual key-value pairs.
  • ​regex_get_all_matches - Return all matches performed by a regular expression on the supplied subject text.
  • ​regex_get_first_match - Return the first set of matches performed by a regular expression on the supplied subject text.
  • ​regex_matches - Tests if a regular expression matches the supplied subject text.
  • ​regex_quote - Update the supplied text value to be properly escaped for regular expressions.
  • ​regex_replace - Perform a regular expression search and replace on the supplied subject text.
  • ​replace - Replace a text phrase with another.
  • ​rtrim - Trim whitespace or other characters from the right return the result.
  • ​split - Splits text into an array of text and returns the result.
  • ​sprintf - formats text with variable substitution.
  • ​starts_with - Returns whether or not the expression is present at the beginning.
  • ​strlen - Returns the number of characters.
  • ​substr - Extracts a section of text.
  • ​to_lower - Converts all characters to lower case and returns the result.
  • ​to_upper - Converts all characters to upper case and returns the result.
  • ​trim - Trim whitespace or other characters from both sides and return the result.
  • ​url_addarg - Parses a URL and returns an updated version with an encoded version of the supplied argument.
  • ​url_delarg - Parses a URL and returns an updated version with the supplied argument removed.
  • url_getarg - Gets the argument's value from a URL.
  • ​url_hasarg - Returns the existence of a argument in the URL.
  • ​url_parse - Parses a URL into its individual components.

capitalize:

Converts the first letter of each word to a capital letter.
Example: we have a text value of hello world and apply the capitalize filter and it becomes Hello World.

concat:

Concatenates 2 text strings together by an optional separator. The value can be any text and the separator can be anything: + , -, _, a space, etc...
Example: we have a text value of hello world and apply the concat filter and it becomes hello world+Xano.
​

contains:

Returns whether or not the expression is found and is case-sensitive. The search term can be any string of text. This returns a "true" or "false" response.
Example: we have a text value of hello world and apply the contains filter this returns a value of "true

ends_with:

Returns whether or not the expression is present at the end. The search term can be any string of text. This returns a "true" or "false" response.
Example: we have a text value of hello world and apply the ends_with filter this returns a value of "false".

icontains:

Returns whether or not the case-insensitive expression is found. The search term can be any string of text. This returns a "true" or "false" response.
Example: we have a text value of hello world and apply the icontains filter this returns a value of "false".

iends_with:

Returns whether or not the case-insensitive expression is present at the end. The search term can be any string of text. This returns a "true" or "false" response.
Example: we have a text value of hello world and apply the iends_with filter this returns a value of "true".

iindex:

Returns the index of the case-insensitive expression or false if it can't be found. The search term can be any string of text. This returns an integer value of where the character(s) exist in the string. The first character in a text string has an index of 0.
Example: we have a text value of hello world and apply the iindex filter this returns a value of "6".

index:

Returns the index of the case-sensitive expression or false if it can't be found. The search term can be any string of text. This returns an integer value of where the character(s) exist in the string. The first character in a text string has an index of 0.
Example: we have a text value of hello world and apply the index filter this returns a value of "1".

istarts_with:

Returns whether or not the case-insensitive expression is present at the beginning. The search term can be any string of text. This returns a "true" or "false" response.
Example: we have a text value of hello world and apply the istarts_with filter this returns a value of "true".

ltrim:

Trim whitespace or other characters from the left side and return the result. The mask text can be any string of text.
Example: we have a text value of hello world and apply the ltrim filter this returns a value of "llo world".

rtrim:

Trim whitespace or other characters from the right return the result. The mask text can be any string of text.
Example: we have a text value of hello world and apply the ltrim filter this returns a value of "hello wo".

join:

Joins an array of text into text via the separator and returns the result. Theseperator text can be any string of text. The array in this example is: [ hello, world, how, are, you]
Example: we have an array of text and we apply the join filter with the seperator "?" this returns: hello?world?how?are?you

Regex (Regular Expression)

Regex or regular expression is a more advance topic that can be useful for finding patterns in text. It is a string of text that allows you to create patterns that help match, locate, and manage text.
Regex typically includes something called delimiters to set the boundaries of the expression. Often times, / will be used as delimiters but almost any character can be used.
Regex filters inside the Query All Records function do not use delimiters. Regex filters in any other variable, function, etc. in Xano require delimiters.
Regex uses special characters, for example:
1
. is any character
2
\d is any number
3
\s is any whitespace
4
\w is any word character
5
* means 0 or more
6
+ means 1 or more
7
​
8
Regex uses additional special characters, these are just to name a few as an example.
Copied!
Some special characters need the \ escape character, which is why regex_quote can be useful to determine this. For example, . and $ do but @ does not.
You can then use ( ) to group matches. For example:
1
/(\w+)@\w+\.\w+/ this would get name of and full email address
2
​
3
​
4
/ is the starting delimiter
5
(\w+) is a matching group, this group must be at least 1 or more word character
6
@ is the symbold @
7
\w+ is at least 1 or more word character
8
\. is the symbol .
9
\w+ is at least 1 or more word character
10
/ is the ending delimiter
Copied!
​

regex_get_all_matches:

Return all matches performed by a regular expression on the supplied subject text.
In this example, we are searching for all matches of /you/ which will return two matches [you, you].

regex_get_first_match:

Return the first set of matches performed by a regular expression on the supplied subject text.
In this example, we are searching for the phrase h with one more additional word characters. The result is how and not Hi because this is case-sensitive.

regex_matches:

Tests if a regular expression matches the supplied subject text. Returns a true or false boolean.
In this example, we are seeing if the subject matches the provided regex. The result will be true because how matches /h\w+/ which is a string starting with h and having one or more word characters after.

regex_quote:

Update the supplied text value to be properly escaped for regular expressions.
The result using / as a delimiter.

regex_replace

Perform a regular expression search and replace on the supplied subject text.
In this example, we are using /(\w+)@\w+\.\w+/ to find an email address and using the replacement to replace it with [email protected] The result is please email [email protected]

replace:

Replace a text phrase with another. Search can be any word in the value and the replacement can be anything.
Example: we have a text value of hello world and apply the replace filter and it becomes hello Xano.

split:

Splits text into an array of text and returns the result. The separator can be anything the words are separated by, in this example, it is the + symbol.
Example: we have a text value of hello+world and apply the split filter and it becomes ["hello", "world"].

Split and trim text into an array example

We can combine multiple filters to format a text string into an array.
For example, we have the string "a , b,c, d"
Notice the inconsistent spaces. If all we do is use split then the spaces will persist in the array. We can combine trim and filter_empty filters to remove unnecessary spaces or blank values.

sprintf

Formats text with variable substitution. This is helpful when wanting to substitute a URL string with a variable that either the use provides or that is gotten from the result of a previous function. - %d is used to replace a number and will enforce a number. - %s is used to replace text.
The first example shows how to use variable substitution with a number using %d.
Example: we have a text value of hello world %d and apply the sprintf filter, it becomes hello world 54321.
The second example will replace %s with text:
Example: we have a text value of hello world %s and apply the sprintf filter, it becomes hello world anything.
We can use multiple arguments on the sprintf filter to replace any number of values. In the example below we have 2 %d and 2 %s. The first %d is equivalent to the first argument of 123. The second %d is equivalent to the second argument of 123. The first %s is equivalent to the first argument of hi. The first %s is equivalent to the second argument of end.
This example becomes: 123 hello 789 world hi this is the end
​

starts_with:

Returns whether or not the expression is present at the beginning. The search term can be any string of text and is case-sensitive. This returns a "true" or "false" response.
Example: we have a text value of hello world and apply the starts_with filter this returns a value of "false".

strlen:

Returns the number of characters.
Example: we have a text value of hello world and apply the strlen filter and it becomes the int 11.
​

substr:

Extracts a section of text. The start pos is based on the # of characters from the beginning with the first char pos= 0. The length can be an int.
Example: we have a text value of hello world and apply the substr filter and it becomes wo.

to_lower

Converts all characters to lower case and returns the result.
Example: we have a text value of HeLLo WoRlD and apply the to_lower filter and it becomes hello world.

to_upper:

Converts all characters to upper case and returns the result.
Example: we have a text value of HeLLo WoRlD and apply the to_upper filter and it becomes HELLO WORLD.

trim:

Trim whitespace or other characters from both sides and return the result. The mask text can be any string of text.
Example: we have a text value of ?!hello world?! and apply the trim filter this returns a value of "hello world".

url_addarg:

Parses a URL and returns an updated version with an encoded version of the supplied parameter. This filter is used to add a key(blog_id, authorname) and a value (123 , john). Those parameters would be added as ?blog_id=123 and ?authorname=john.
This URL becomes https://www.xano.com/?user_id=1 after the filter is applied

url_delarg:

Parses a URL and returns an updated version with the supplied parameter removed. This filter is used to delete a key(blog_id, authorname). Those parameters would be deleted at the end of a url as ?blog_id or ?authorname.
This URL becomes https://www.xano.com/ after the filter is applied

url_hasarg:

Returns the existence of an arguments in the URL.
The result of this filter will be true because the argument test

url_parse:

Parses a URL into its individual components.
The result of this filter will parse the URL into its individual components.
In this example, the filter parses the URL into its individual components.