-
Notifications
You must be signed in to change notification settings - Fork 3
Home
RegHex is an application to validate and analyze regular expressions directly in your browser.
The first step in using RegHex is to decide which language you will be using. Currently the choice is rather limited but may be expanded over time. Just select the programming language you want to use in the drop-down menu at the top of the application.
Once the language has been selected, you may write a regular expression with this language's syntax into the left text area labeled "your regular expression". Additionally, you may want to set some of the flags located below the text area. Only flags supported by the currently selected language are enabled.
Now, the primary feature of RegHex can be used. Enter an example text that should be matched by your regular expression into the right text area labeled "string to match". If your regular expression matches a sub-string of the sample text, the matched text will be highlighted. In case there is more than one sub-string matched, you can cycle through them by using the forward and backward buttons below the text area.
If the language supports sub-expressions, you can use the "subexpressions" button to show all the parts of the matched sub-string. If you want to test more than one sample text at the same time, you can click the Plus button below the right text area to add more text areas. They behave exactly the same as the first one. Each additional sample area can be removed individually by pressing the Minus button below it.
Finally, there is a code generation field below the sample areas. Here you get a simple code snippet shows how to use the entered regular expression in the selected language. Your regular expression is already filled in. In case you need any more help with regular expression in the respective language, you can use the link(s) seen in the lower left-hand side.