Last Updated on
Regex Builder utility will enable user to create/generate various regular expression patterns with ease using an intuitive web based graphical user interface. Regex Builder utility will also provide capability to test the generated regular expression pattern with help of embedded Regex Tester. This utility will be a great help for various users who are not well versed in writing/creating regular expression, as user will not have to write the Regular Expression manually. But user can generate the Regular Expression on the fly just by selecting options on user friendly GUI and then test the generated patterns by using embedded Regex Tester utility.
User must have some basic knowledge of the regular expression patterns used in java.
Generate Regex Option in Ephesoft
There is an option for generating the regex pattern near to every field where regex pattern is required as shown in the below figure.
Regex Builder dialog will appear when a user clicks upon Generate regex button. Regex builder dialog will look as shown in figure below:
Contents of Regex Builder
As shown in the figure above, Regex Builder dialog contains the following sections:
- Text Section
- Regex Quantifier
- Regex Group
- Regex Tester
- Button Panel
- In this section user can match either “Match exact text” or “Text in range” (as shown in the above fig.). For example if a user wants to match exact String like john, Invoice etc. then user can select the “Match exact text” option and can write the exact string to the text field.
- Match exact text section also contains many other options like any special character text, word boundary, any character etc. as shown in the above figure
- If a user wants to match any string with text in range then user can select any number of desired options in the “Text in range” section. For example if a user wants to select the text in range [a-zA-Z0-9], then it could be easily selected by just clicking the check boxes accordingly.
- Text in range section also contains many other options like special character, word boundary, any white space character, upper case range, lower case range, digit range etc. as shown in the above figure.
- This section gives user a capability for selecting the quantitative options for the input text selected. For example if a user wants to select a string which can be any letter or any digit, any number of times then user can directly select the option “Any number of times” by just selecting the required radio button.
- User can also specify the number in this section. For example if the user wants to select a string which contains any letter 3 times, then user can directly select this radio button and can enter the desired number . User can also select minimum and maximum number of times by just selecting the option for between min and max time.
- In this section user can select options for case insensitive search or grouping feature for java regular expression. For example if a user wants to search for a word Invoice (case insensitive), then user have a facility for selecting these options by just checking the check box.
- User can also select the option for applying regex quantifier to the entire group by just selecting the option for applying regex quantifier to the entire group.
- If the user wants to perform any “Followed by” or “Or” operation then user has to add the new tab by just clicking on add button as shown in the below figure. For example if a user wants a string that contains three digits followed by a comma then first user has to select the input for any digit three times then followed by comma.
- Clicking upon add button will add a new tab which contains the similar options as that of previous tab. Here the user can select anything like Followed by, Or, Only if followed by etc. options. In this way user can add any number of tabs for generating the required regular expression.
- Remove button will close the last opened tab. Remove button will be enabled only in case if more than one tab is there on the regex builder dialog.
- Reset button will reset all the values selected for generating the regex pattern.
- Close button will close the regex builder dialog.
Regex Tester contains the following sections:
- Regex Pattern: This text area will contain generated regex pattern based on the inputs.
- String to be matched: This text area will contain the sample string that you specify which is to be matched against the generated regex pattern when the “Test Regex” button is selected.
- Test Regex: This button will find all the matches of regex pattern within the string. Terms that match the regex in the “Strings To Be Matched” section will be highlighted in alternating green/yellow colors(As shown in the below figure).
- Select Regex: This will populate the generated regex pattern to the field from where this regex builder utility is being opened.