EnglishFrenchSpanish

OnWorks favicon

rgxg - Online in the Cloud

Run rgxg in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command rgxg that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


rgxg - ReGular eXpression Generator

SYNOPSIS


rgxg COMMAND [ARGS]

DESCRIPTION


rgxg is a generator for (extended) regular expressions.

For instance it is useful to generate a regular expression to exactly match a numeric
range or all addresses of a given CIDR block.

COMMANDS


alternation [options] [PATTERN...]

Generate a regular expression that matches any of the given patterns.

Options

-N Omit the outer parentheses, if any, of the regular expression. This option
can be useful if the generated regular expression is used within another
alternation.

-h Display help and exit.

Examples

Match either lion, elephant, rhino, buffalo or leopard:
$ rgxg alternation lion elephant rhino buffalo leopard
(lion|elephant|rhino|buffalo|leopard)

cidr [options] CIDR

Generate a regular expression that matches all addresses of the given CIDR block. Both
IPv4 and IPv6 CIDR blocks are supported.

Options

-N Omit the outer parentheses, if any, of the regular expression. This option
can be useful if the generated regular expression is used within another
alternation.

-l Match only IPv6 addresses with lower case letters. By default both lower and
upper case letters are matched.

-U Match only IPv6 addresses with upper case letters. By default both lower and
upper case letters are matched.

-u Do not match IPv6 addresses with zero compression (second form of text
representation of IPv6 addresses mentioned in section 2.2 of RFC 4291).

-s Do not match IPv6 addresses in mixed notation (third form of text
representation of IPv6 addresses mentioned in section 2.2 of RFC 4291).

-h Display help and exit.

Examples

Match 192.168.0.0/24:
$ rgxg cidr 192.168.0.0/24
192.168.0.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])

Match 2001:db8:aaaa:bbbb:cccc:dddd::/96 limited to lower case letters:
$ rgxg cidr -l 2001:db8:aaaa:bbbb:cccc:dddd::/112
2001:0?db8:aaaa:bbbb:cccc:dddd((::[0-9a-f]{1,4}|::|:0?0?0?0(::|:[0-9a-f]{1,4}))|:0.0(.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){2})

Match 2001:db8:1234::/48 restricted to uncompressed standard notation:
$ rgxg cidr -u -s 2001:db8:1234::/48
2001:0?[Dd][Bb]8:1234(:[0-9A-Fa-f]{1,4}){5}

escape [options] STRING

Generate the regular expression which matches the given string by escaping the escape
characters.

Options

-h Display help and exit.

Examples

Match '1+(2*(3-4))':
$ rgxg escape 1+(2*(3-4))
1\+\(2\*\(3-4\)\)

help [COMMAND]

Describe the usage of rgxg or the given COMMAND.

range [options] FIRST [LAST]

Generate a regular expression that matches the number range between FIRST and LAST. If
LAST is omitted the regular expression matches all numbers which are greater than or
equal FIRST. The numbers must be positive and given in base-10 notation.

Options

-b BASE
Generate the regular expression for the number range with base BASE. The
BASE must be in the range between 2 and 32. The default base is 10.

-N Omit the outer parentheses, if any, of the regular expression. This option
can be useful if the generated regular expression is used within another
alternation.

-l For bases greater than 10 only match lower case letters. By default both
lower and upper case letters are matched.

-U For bases greater than 10 only match upper case letters. By default both
lower and upper case letters are matched.

-h Display help and exit.

-z Only match numbers with leading zeros. By default the number of leading
zeros depends on the length (i.e. the number of digits) of LAST (see also
-m). The default is to not match numbers with leading zeros.

-Z Match numbers with a variable number of leading zeros. By default the
maximum number of leading zeros depends on the length (i.e. the number of
digits) of LAST (see also -m). The default is to not match numbers with
leading zeros.

-m LENGTH
with -z or -Z, the minimum LENGTH of matched numbers. For instance the
number 5 with LENGTH set to 3 and -z option set is matched as '005'. If
LENGTH is lesser than or equal to the number of digits of LAST, this option
has no effect.

Examples

Match the numbers from 0 to 31:
$ rgxg range 0 31
(3[01]|[12]?[0-9])

Match numbers from 0 to 31 with base 2:
$ rgxg range -b 2 0 31
(1[01]{0,4}|0)

Match 0 to 31 with base 16:
$ rgxg range -b 16 0 31
1?[0-9A-Fa-f]

Match 0 to 31 with base 16 limited to upper case letters:
$ rgxg range -b 16 -U 0 31
1?[0-9A-F]

Match 0 to 31 with base 16 limited to lower case letters:
$ rgxg range -b 16 -l 0 31
1?[0-9a-f]

Match 00 to 31:
$ rgxg range -z 0 31
(3[01]|[0-2][0-9])

Match 0000 to 0031:
$ rgxg range -z -m 4 0 31
(003[01]|00[0-2][0-9])

Match 0 to 31 and 00 to 31 and 000 to 031:
$ rgxg range -Z -m 3 0 31
(0?3[01]|0?[0-2]?[0-9])

Match 0 to 31 and omit outer parentheses:
$ rgxg range -N 0 31
3[01]|[12]?[0-9]

Match all numbers greater than or equal to 4096:
$ rgxg range 4096
([1-9][0-9]{4,}|[5-9][0-9]{3}|4[1-9][0-9]{2}|409[6-9])

version
Prints the version of the rgxg command.

EXIT STATUS


The exit status is 0 if the regular expression has been successfully generated. If an
error occurred the exit status is 1.

Use rgxg online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    GenX
    GenX
    GenX is a scientific program to refine
    x-ray refelcetivity, neutron
    reflectivity and surface x-ray
    diffraction data using the differential
    evolution algorithm....
    Download GenX
  • 2
    pspp4windows
    pspp4windows
    PSPP is a program for statistical
    analysis of sampled data. It is a free
    replacement for the proprietary program
    SPSS. PSPP has both text-based and
    graphical us...
    Download pspp4windows
  • 3
    Git Extensions
    Git Extensions
    Git Extensions is a standalone UI tool
    for managing Git repositories. It also
    integrates with Windows Explorer and
    Microsoft Visual Studio
    (2015/2017/2019). Th...
    Download Git Extensions
  • 4
    eSpeak: speech synthesis
    eSpeak: speech synthesis
    Text to Speech engine for English and
    many other languages. Compact size with
    clear but artificial pronunciation.
    Available as a command-line program with
    many ...
    Download eSpeak: speech synthesis
  • 5
    Sky Chart / Cartes du Ciel
    Sky Chart / Cartes du Ciel
    SkyChart is a software to draw chart of
    the night sky for the amateur astronomer
    from a bunch of stars and nebulae
    catalogs. See main web page for full
    download...
    Download Sky Chart / Cartes du Ciel
  • 6
    GSmartControl
    GSmartControl
    GSmartControl is a graphical user
    interface for smartctl. It allows you to
    inspect the hard disk and solid-state
    drive SMART data to determine its
    health, as w...
    Download GSmartControl
  • More »

Linux commands

  • 1
    abc2abc
    abc2abc
    abc2abc - a simple abc
    checker/re-formatter/transposer ...
    Run abc2abc
  • 2
    abc2ly
    abc2ly
    abc2ly - manual page for abc2ly
    (LilyPond) 2.18.2 ...
    Run abc2ly
  • 3
    coqmktop
    coqmktop
    coqmktop - The Coq Proof Assistant
    user-tactics linker ...
    Run coqmktop
  • 4
    coqtop
    coqtop
    coqtop - The Coq Proof Assistant
    toplevel system ...
    Run coqtop
  • 5
    g.copygrass
    g.copygrass
    g.copy - Copies available data files in
    the current mapset search path to the
    user�s current mapset. KEYWORDS:
    general, map management ...
    Run g.copygrass
  • 6
    g.dirsepsgrass
    g.dirsepsgrass
    g.dirseps - Internal GRASS utility for
    converting directory separator
    characters. Converts any directory
    separator characters in the input string
    to or from na...
    Run g.dirsepsgrass
  • More »

Ad