ZennoLab

Automate everything

User Tools

Site Tools


en:creating-a-regular-expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:creating-a-regular-expressions [2017/12/15 11:59]
deemer [What are regular expressions]
en:creating-a-regular-expressions [2017/12/15 13:02] (current)
deemer [How to quickly create a regular expression in ZennoPoster]
Line 18: Line 18:
 ===== How to quickly ​ create ​ a regular ​ expression in  ZennoPoster ===== ===== How to quickly ​ create ​ a regular ​ expression in  ZennoPoster =====
  
-You can use "​Designer of regular expressions"​ for the creation of regular ​expressions. ​Open it by pressing ​corresponding ​button in the project ​editor menu, or go from the window ​view of page text.  \\  \\ {{:​en:​path_to_regexp_1_eng.png?​200}}{{:​en:​path_to_regexp_2_eng.png?​200}} \\  \\ In the left pane of the opened window you should paste text for parsing. Most often, you can create a regular expression ​to parse text, by using the start or end of the search text, as well as the text that stands before search text, or after it.To this end, below the regular expression you see four fields, when you edit one of them you see changes in regular expression. ​ \\ There is an option in the middle of designer to choose the middle of the text, if you select "​Enable linebreaks"​ then linebreaks can be in search text.If you do not check this box, the search is within one line. There is also a flag that the shortest match of search text is taken. You will understand the usefulness of this flag using regular expressions. ​ \\ Click "​test",​ and in the right pane will be parsing results (if there are matches). Matches can be multiple, they will be divided by the numbers. If everything is correct including the search text then the regular expression can be taken from the top field. If you get something wrong, try changing your search criteria. ​ \\  \\ {{:​en:​regexpbuilder_eng.png?200}}+To create regular expressions,​ you can use the helper - **Regular ​expressions ​designer**You can open it by pressing ​the button ​**Regexp tester** ​in the advanced ​editor menu, or go from the window to receive mail by pressing **This ​is not what I need**.
  
 +{{:​en:​path_to_regexp_en.png}}
  
 +{{:​en:​email_end_new_en.png}}
 +
 +In the left pane of the opened window you should paste text for parsing. Most often, you can create a regular expression to parse text, by using the start or end of the search text, as well as the text that stands before search text, or after it. To this end, below the regular expression you see four fields, when you edit one of them you see changes in regular expression.
 +
 +There is an option in the middle of designer to choose the middle of the text, if you select **Enable line breaks** then line breaks can be in search text. If you do not check this box, the search is within one line. There is also a flag that the **Shortest match** of search text is taken - the results will result in the shortest substring corresponding to the composed expression. When turned off, respectively - the longest.
 +
 +Click **Test**, and in the right pane will be parsing results (if there are matches). Matches can be multiple, they will be divided by the numbers. If everything is correct including the search text then the regular expression can be taken from the top field. If you get something wrong, try changing your search criteria.
 +
 +{{:​en:​regex_builder_en.png}}
 +
 +Over the field of the regular expression, the **History** button has appeared, here the received regular expressions are stored, which you can use later.
 +
 +{{:​en:​regex_history_en.png}}
 +
 +The program allows you to use **Group regular expressions** and save several results at once. Further results can be save by groups into variables with the choice of the match number, as well as in a table with the ability to exclude columns.
 +
 +{{:​en:​regex_group_en.png}}
 ===== Note ===== ===== Note =====
  
en/creating-a-regular-expressions.txt · Last modified: 2017/12/15 13:02 by deemer