...
All possible operations with this "cube":
Escape
...
sequences
Escaping characterssequences. This action replaces the characters * +? | {[() ^ $. #
And space with escape codes. This technique is often used to work with queries and for the regular expression engine to use these characters literally, rather than as commands or metacharacters.
...
Note |
---|
Please note that if the regular expression returns an empty string, then even if the "Error with empty response" setting is enabled, the action will be released on the green branch: for example, the site has nothing in the title tag: |
What to take
...
First
The first match found will be saved to the variable.
...
Save all search results to a list.
One
...
match
Keep only one match.
In the field that appears, you can enter the sequence number of the match (numbering from zero!) Or select the Last or Random (random) value.
...
Match
...
No.
Save to the list only the specified match numbers (numbering from zero !, specify separated by commas).
...
To variables
This function is used when working with group regular expressions. An example under the spoiler:
Expand | |||||
---|---|---|---|---|---|
| |||||
Let's imagine that there is the following text:
And the task is to disassemble it into its components. To do this, we will use the following regular expression: This is how the output looks in the Regular Expression Tester: Let's imagine that we need to take in variables the day, month and year from the second row. Here's how you can do it: The match number in our case is the line number. Because the numbering here starts from zero, then in order to take the second line, we indicate 1 Next, you need to specify the group number and the variable to which the result will be saved. Here, too, the numbering of groups starts from zero. But group 0 contains the entire found line ( |
...
To table
It is very similar to the previous function (To variables) with the difference that not one result is saved here, but everything is stored in a table. You can exclude some of the groups found from the final result.
...
Converts an integer value to Unicode characters .
Each Unicode character has its own numeric code and this functionality allows you to convert a numeric value to the corresponding characters. For example, the symbol ♛ has a
numeric value 9819
...
ToLower
Changes letters to lowercase depending on the selected property: either all letters, or only the first letter of the string, or the first letter in each word.
For example, we are VERY ANNOYED BY WRITING CAPS LOCK . We pass the text through this macro and get the normal spelling.
...
Reverse action of the previous one. Changes the case of letters to uppercase: either all letters, or only the first letter of the string, or the first letter in each word.
For example, we need All Words in the Heading to Start With Capital Letters (a frequent reception on foreign resources) - we use this “cube” in the “First letter in every word” mode.
...
Trim
This is the trimming of extra characters in the string. It is mainly used when you need to clean up a string from extra spaces, line breaks, tabs, which so often remain as a result of parsing. In this case, you can clean from the beginning of the line, from the end and simultaneously. In addition, you can crop your own characters, for example, a frequent task is to remove dots in titles.
Was: some text
(spaces at the beginning and at the end)
Now: some text
UrlDecode
Decodes a URL-encoded string.
If characters such as spaces and punctuation marks are passed in the HTTP request, then they may be misinterpreted by the receiving side. Therefore, this macro is necessarily used when generating URL requests.
This action looks most obvious when decoding the Cyrillic alphabet:
Was: % D0% 9F% D1% 80% D0% B8% D0% B2% D0% B5% D1% 82% 2C% 20% D0% BC% D0% B8% D1% 80% 21
It became: Hello world!
...
UrlEncode
The function is the opposite of the previous one. Encodes a URL string. Often used for HTTP requests.
It was: https://zennolab.com/
Now: https% 3a% 2f% 2fzennolab.com% 2f
...
Into a variable
This action simply saves everything that you add to the input window - variables, text, symbols, project constants, into a separate variable.
...
To the list
This action splits the text using the specified in the properties of the delimiter into lines and writes them to the list.
...
To the table
Much the same as in the previous action, but saves the data in a table. Naturally, in this case it is necessary to specify separators not only for rows, but also for columns. For example, for tables in Excel format, you need to specify your character as a column separator and enter in the field next to {-String.Tab-}
Replacement
This action searches the string for a substring, replaces it with another, and then saves the result to a variable. Everything seems to be simple, but thanks to the possibility of using regular expressions, the potential of this action is greatly expanded. As well as in other actions, you can replace not only the first found match, but all or specified indices (separated by commas or a range specified by a hyphen).
...
lowercase depending on the selected property. For example, let's take the line
CHANGES REGISTER OF LETTERS TO LOWER
All
Replaces all uppercase characters in the text with lowercase.
It was | Has become |
---|---|
CHANGES REGISTER OF LETTERS TO LOWER | changes the case of letters to lowercase |
Beginning of words
Changes the case to lowercase for the first character of each word in the text.
It was | Has become |
---|---|
CHANGES REGISTER OF LETTERS TO LOWER | cHANGES rEGISTER oF lETTERS tO lOWER |
First character
Changes the case of only the first character in the specified text.
It was | Has become |
---|---|
CHANGES REGISTER OF LETTERS TO LOWER | cHANGES REGISTER OF LETTERS TO LOWER |
...
ToUpper
...
Changes the case of letters to uppercase depending on the selected property. For example, let's take a string lowercase text
All
Replaces all lowercase characters in the text with uppercase.
It was | Has become |
---|---|
lowercase text | LOWER CASE TEXT |
Beginning of words
Changes the case of the first character of each word in the text to uppercase.
It was | Has become |
---|---|
lowercase text | Lower Case Text |
First character
Changes the case of only the first character in the specified text.
It was | Has become |
---|---|
lowercase text | lower case text |
...
Trim
This function is used to remove extra characters at the beginning and \ or end of the passed string.
It is most often used when you need to clean up a string from extra spaces, line breaks, tabs, which so often remain as a result of parsing.
What to cut
Here you need to select the characters to be deleted. It can be either a preset option for all types of whitespace characters (space, enter, tabulation), or you can specify your own characters.
Where to trim
Where to trim characters - Beginning, End, or Beginning and End.
Was: some text
(spaces at the beginning and at the end)
Now: some text
...
UrlDecode
Decodes a URL-encoded string.
If characters such as spaces and punctuation marks are passed in the HTTP request, then they may be misinterpreted by the receiving side. Therefore, this macro is necessarily used when generating URL requests.
This action looks most obvious when decoding the Cyrillic alphabet:
Was: % D0% 9F% D1% 80% D0% B8% D0% B2% D0% B5% D1% 82% 2C% 20% D0% BC% D0% B8% D1% 80% 21
It became: Hello world!
...
UrlEncode
Only Latin letters, numbers and a few punctuation marks are allowed in the URL. All other characters that are transmitted in the HTTP request must be encoded using UrlEncode, otherwise the server may misinterpret the request.
Encode only variables values
It is very convenient to use when making HTTP requests, because you do not need to encode the site address, but only the parameters. This is what the action settings might look like:
...
The {-Variable.keyword-}
variable contains the text what urlencode is. After execution, the following line will be written to the {-Variable.url-}
variable -https://www.google.com/search?q=%d1%87%d1%82%d0%be+%d1%82%d0%b0%d0%ba%d0%be%d0%b5+urlencode
It was: https://zennolab.com/
Now: https% 3a% 2f% 2fzennolab.com% 2f
...
To variable
This action simply saves everything that you add to the input window - variables, text, symbols, project constants, into a separate variable.
...
To list
This action splits the text using the specified in the properties of the delimiter into lines and writes them to the list.
Separator
Enter - newline character
Space
Custom text - here you can specify both a single character (for example
;
) and several characters (note: if you specify several characters here, they will be considered as one separator!)Custom Regex - using regular expression.
...
To table
This action splits the transmitted text into rows and columns (according to the specified delimiters) and places the data into a table.
Separators
Enter - newline character
Space
Custom text - here you can specify both a single character (for example
;
) and several characters (note: if you specify several characters here, they will be considered as one separator!)Custom Regex - using regular expression.
...
Replace
...
This action searches the string for a substring, replaces it with another, and then saves the result to a variable.
What to search
The substring to find (or a regular expression if the Regex search type is selected).
What to replace v
What the found substring will be replaced with.
Search type
Text - exactly the same string that was passed in the What to search field is searched for.
Regex - in the What to search field, write a regular expression that will be used to search for a match.
What to replace
First
The first match found will be replaced.
All
All matches will be replaced.
One match
Replace only one specified match (numbering from zero!) Or Last.
Matches No.
Specify, separated by commas, the numbers of the matches to be replaced (numbering from zero!).
...
Translation
Translates strings from one language to another.
...
Source language, Target language
From which and into which language the text should be translated.
In addition to choosing the API that will translate, it is important to indicate the language of the source and the final translation. Here are some examples: English - en, Spanish - es, German - de, Russian - ru ( full list )
You can specify the language “auto” and then the system will try to determine the target language
...
itself, but the result is not guaranteed.
Note |
---|
Language codes may differ from service to service. For a complete and reliable list of codes, you should refer to the documentation of the selected service. |
Additional parameters
Additional parameters can significantly expand the capabilities of this "cube", but each API has its own. For example, by passing the API key, you can achieve more stable translator work.
API keys for services can be added in ZennoPoster settings.
...
Use project proxies (if possible)
If possible, the transfer request will be made using the currently installed proxy.
Prepare JavaScript
Processes a string for correct use in JavaScript. Mostly escapes quotes and other specials. symbols. This macro prepares text so that it can be inserted as a string in a JavaScript or IF action. ProjectMaker has a JavaScript tester where you can inspect (test) your code. This "cube" will help you to escape quotes, apostrophes and other special characters.
...
Sometimes it is still required to perevesti ( to translate) Cyrillic to Latin. This action also serves this action.
...
...
Useful links
Regular Expression Tester
Variable window