RegExp is a program designed to test regular expressions, but does not exclude data processing. It has several libraries with ready-made regular expressions for solving some parsing tasks. The program is only a shell, parsing (parsing) is performed by the PCRE engine. The program is written based on the Re g Exp program I wrote earlier on AutoIt3
Version 0.5.2 from 2022 Author AZJIO
Site http://azjio.ucoz.ru Discussion:
![]()
![]()
![]()
![]()
![]()
az j io.ucoz.ru p urebasic.fr p urebasic.mybb.ru usbtor.ru p uppyrus.org
Performs search/replace, etc. with a regular expression
When launched, the program checks the files in the "Library" folder and adds them to the list of libraries. The library contains regular expressions, flags and text processing. The content of the library is displayed on the right side of the window. Clicking on a library element inserts the data into the fields. Two buttons (Add and Delete) are intended for adding (overwriting) and deleting items. By default, the name of the selected item is used, which allows you to overwrite, i.e. update item data. If you need to add a new one, then specify the new name of the item. The library allows you not to lose important regular expressions and always have access to them.
The result is displayed in the lower left window. The result depends on the search mode. This can be found-not-found text, or the result of a replacement, or a list of elements, as well as a regular expression error warning in English. language.
![]()
Search - returns "Worn" or "Not Found".
![]()
Replace - returns the text that has been replaced.
Nearby there are two checkboxes: support for Unescape characters (\r\n\t) and support for groups (\1...\9).
![]()
Array - returns the entire found elements matching the regular expression.
![]()
Groups - returns the elements of the regular expression that are in parentheses.
![]()
Stepping - returns the position, length, and found text of the regular expression.
The flag " With markup " allows you to make the output of the results more visual, with the numbers of the found elements.
There are two fields below the "Start" button. The bottom one shows the execution time of the current regular expression on the current text. The top one is the time of the previous test. This is necessary for speed comparison. If the current test is completed faster than the previous one, then the lower field is highlighted in green, otherwise in red.
Ini, you can set the color of the window elements and the highlight color of metacharacters in the regular expression field. The style is selected like this: style=style1, while the ini-file should contain the [style1] section with color settings. For example, the ini file contains several ready-made
styles.
Some combinations can be inserted using the "asterisk" - "*" button, the menu of which can be made independently in Menu.ini.
The history button saves 30 items of the last regular expression usage. Adjusted by parameter maxhistor=30.
As a tool in PureBasic, you can add with a com line:
-l:PureBasic -nu -i:4 "%TEMPFILE"
Here the keys have the following meaning:
-l:PureBasic - library selection
-nu - do not update (or freeze the processed text so that it does not change when other items are clicked)
-i:4 - selection of the 4th item, counting from 0. The parameter must be after the -l key: otherwise it will work when the library is not open "%TEMPFILE" the path in quotes of the file being opened into the window of the processed text.
This functionality allows you to automatically open RegExpPB with the necessary settings and search or process the source with
using regular expressions.
OnTop - short name "On top of all windows"
Do not update - when pasting from the library, the text for processing is not replaced. Suppose you need to process your text with different regular expressions.
There are also 5 included flags that can be included in the regular expression itself using the (?s) method, etc.
![]()
![]()
Open - Open a text file for processing. Clear - Clears 4 input fields.
![]()
![]()
Add - Add a sample to the library. Delete - Delete the selected library item.
![]()
Metacharacters - a choice of ready-made combinations for insertion into a regular expression pattern.
![]()
Move up - Moves the text from the results to the window for processing. Useful if some text needs to be run through a dozen regular expressions. After each application, press the button to move the processed text in the results up to be processed by the next regular expression.
![]()
Copy - copies the finished construction to the clipboard for pasting into the code. To do this, in the "template" folder there are ready-made templates of the same name, in which the variables are replaced by the corresponding fields. To make the program universal, there is a copysel=0 parameter, if you change it to copysel=1, then instead of using templates of the same name, a folder will open with the ability to select a template file, so you can
even for one mode, make several templates, not to mention different programming languages.

[Set] - section of main parameters width = 800 - window width
height = 600 - window height
fontsize = 11 - font size
maxhistor = 30 - maximum number of history items topmost = 0 - top of all window
lastlib = PureBasic - last library selected at program startup
copysel = 0 - Flag to switch template selection by file open method
style = style1 - style section selection
[regexp] - history of regular expressions
1 = [А-Ра-яЁё]+ - one of the elements of the story 2 = (\r\n|\r|\n){2,}
[style1] - style section
gui = f - window color (Windows only)
gadget = f - color of gadgets (input field) (Windows only)
gadgetfont = f - font color (window texts, checkboxes, labels) (Windows only)
type = 1 - color type, background or font (for regular expressions)
background = f - background color default = 0 - font color
select_bg = f99 - background color of selected text select_fnt = 0 - font color of selected text caret = 0 - cursor color
re_Repeat = BFFFBD - repeat color {n,m}

re_SqBrackets = BDF7FF - color of square brackets [] re_RndBrackets = FFBDBD - color of round brackets () re_AnyText = E6DDFF - color of any text .*?
re_Meta = FFFFA5 - color of \w metacharacters, etc. re_Borders = FFDFA5 - border color \A \b etc.
re_ChrH = FFC1F7 - character code color \x01 \x{01}
The color can be set in a simplified way, for example "F" means "FFFFFF",
"3F" = "3F3F3F", "F95" = ""FF9955"
The part of the template enclosed in square brackets is called the character class. Inside brackets, metacharacters lose their special meaning, except for metacharacters belonging to this class. Only 4 characters \ - ] [ need to be escaped. If the character "-
" is at the end of the enum, it does not need to be escaped. The pattern can use range metacharacters, but not boundary metacharacters like \A, \B, \Z, \z, and the \b metacharacter means the backspace character 'backspace'. that ranges like [a-z] use a UTF-8 sequence, not ASCII.
\K - the preceding match to the left of \K, i.e. text1 \K text2 , find text2 preceded by text1 .
text. Don't exclude errors: \QD:\Edit\1.txt\E
\x{50}\x{65}\x{72}\x{6C} is a Perl word. Try from \x{01} to
\x{7F}, which in decimal means characters from 1 to 127. Or in UTF encoding \x{044F} is equal to the character "i"
Placed at the beginning of a regular expression or group.
The state of modifiers is off by default, so you need to enable it to use it.
Usage example : (?i)(Text) or ((?-i)Text), you can combine (?is)(Text) or ((?imsx)Text)
It is allowed to combine (?im-sx:Text) , sx flags are off
(?i:...) - group, case insensitive, for example (?i:Text) . This only works for Latin characters.
These 4 groups are fixed length, you cannot use
pattern on the right , for example (Text)(?=Text)
pattern on the right , for example (Text)(?!Text)
pattern on the left , e.g. (?<=Text)(Text) , see also \K
pattern on the left , e.g. (?<!Text)(Text)
\k<name> is the same as calling \1 or $1
{n,} - repeat the previous character n or more times ( {n,}? - preferably the smallest capture)
{n, m} - repeat the previous character n to m times ( {n,m}? - preferably the smallest capture)
* - repeat the previous character 0 or more times. Same as {0,} . The largest grip that will match the rest of the pattern.
+ - repeat the previous character 1 or more times. Same as {1,} . The largest grip that will match the rest of the pattern.
{0,1} . The second meaning of the symbol ? after the repeat character .*? - greed, see below
?? - preferably the smallest capture, e.g. ([az]??)g for 'gg' returns two empty strings
Capture without returning to previous search steps. Captures anything that matches the previous character, not caring about matching the rest of the pattern. The character or range of characters following a supergreedy metacharacter must not be consumed by its range, otherwise such a pattern will never be found and is meaningless. The sole purpose of the overgreedy metacharacter is to speed up capture.
Example [[:upper:]]{2} - searches for repeated uppercase letters. Invert the range like so: [[:^digit:]]
) from Chr(9) to Chr(13) and Chr(32). Same as [\f\n\r\t\v ]
These flags have no effect in AutoIt3
\p any punctuation character
\l - means that the next regular expression character is converted to lower case.
\u - means that the next character of the regular expression is converted to upper case.
\L...\E means that all characters in the regular expression between \L and
\E are converted to lower case.
\U...\E means that all characters in the regular expression between \U and \E are converted to uppercase.
\x - any hexadecimal character
\< - the beginning of a word, i.e. the boundary between a character satisfying \W and a character satisfying \w
\> - end of word, i.e. boundary between character matching \w and character matching \W
{,n} - repeat the previous character from 0 to n times
from lowercase vowels
textbooks
Regular expressions . J. Friedl. 3rd edition and also html edlinsoft.blo g spot.com - for .NET Framework, explained with examples. msdn.ru
Control characters ( wiki) a j axforum.ru
Regular expressions on the wiki
re g expstudio.com - Regular Expressions for Delphi
docs.note p ad-plus-plus.org - Official source of Notepad++ (English)
p cre.org - Official reference of the PCRE engine
Online testers
re g exr.com - there are many ready-made regular expressions here in the Community
for javascript , for php (pagecolumn.com) cune y tyilmaz.com - for javascript
p hp-include.ru -on flash player re g ex101.com
debu gg ex.com - shows structurally
Programs for the test Reg exBuddy - cool and paid
Reg Exp - free, AZJIO , PCRE, AutoIt3 Ex p resso
Software license
The program is free
For use "as is", the responsibility for misuse lies with the user.
The program can be included in a commercial project, but without increasing the cost due to the program, since it is free. This allows use in any assembly as an additional tool.
source license
You may only modify the source for your own use.
Permission is granted to study and use parts of the code. It is forbidden to redistribute the upgraded version. It is forbidden to change the "About" dialog.
For any questions not listed here, please contact the author to discuss the conditions.
Added checkbox "On top of all windows"
Added "Move Up" button to process text multiple times with different regular expressions.
Fixed replacement with references to groups without groups Added command line like -l:PureBasic -nu -i:4 "%TEMPFILE"
The "Add" button uses the name of the selected item, and if it is not changed, it offers to overwrite the current one.
Fixed library reading regvar, could not read with empty data.
Added "Do not update"
Added ini-file parameter copysel = 0. Enables template selection in Explorer.
Added PureBasic regular expression library
Now bit flags when reading/writing to a library (libraries are converted with a bit flag)
Checking if in the field for replacing links to groups, then the group support checkbox is checked.
Added history of regular expressions with saving. Added hotkey Ctrl+Enter
Added timer color.
Added ini-file parameters: "On top of all windows", the number of history items.
Added save library selection
Added 2 buttons "Add" and "Remove" to populate regular expression libraries.
Added "open file" and "drag and drop" buttons to the "text to process" (UTF-8) window.
The color settings are output to the ini file.
Added regular expression libraries
Since in Linux there was a double reading of data when clicking on an item, the repeated reading was ignored, but the problem is that you need to click another item to update.
If there is no library, when you click the "Add" button, create a library.
For Linux, fix the functionality of calculating the execution time of a regular expression.
Add a flag to hide 5 flags in the GUI for those who don't use PureBasic and enter the flags in the regex itself. Wherein
need to reset them.