|
An ExampleIn this example we will create a trivial domain name parser. This is not intended to be the best example of using Kodos, rather, it will focus on using as many features as possible.First, let us enter our regular expression. This regular expression will use group names to capture the host, domain and the domain class as well as the port number. Additionally, an unnamed group will be captured which seperates the class from the port (for the sole purpose of demonstration). Fig. Our regular expression
Fig. Ignoring case
Fig. Our initial string
Fig. Pattern does not match or there is a syntax error
Fig. Our final string
Fig. Pattern successfully matches the input string
Fig. The groups list
The matching string can be seen by viewing the "match" output tab Fig. The groups list
|