IT. Expert System.

REGEX

Alternation / Conditionals


Alternation / Conditionals

Alternation constructs modify a regular expression to enable either/or matching.

Conditionals modify a regular expression to enable conditional matching.

Alternation

The vertical bar character ('|') can be used in a regular expression to match any one of a series of patterns, where the ('|') character separates each pattern.

This construct has the form:

(...|...)

where "..." is a subexpression to be matched.

Examples:

gr(a|e)y will match either "gray" or "grey"
th(is|at) will match "this", or "that"

Conditional w/ Expression

This language construct attempts to match one of two patterns depending on whether there is a match on the an initial pattern.

This construct has the form:

(?(expression)yes|no)
Value Description
expression Specifies the initial pattern to match
yes Specifies the pattern to match if expression is matched
no (optional) Specifies the optional pattern to match if expression is not matched

Conditional w/ Captured Group

This language construct attempts to match one of two patterns depending on whether it can match a specified captured group.

This construct has the form:

((?(name)yes|no ))

or

(?(number)yes|no)
Value Description
name Specifies the name of a capturing group
number Specifies the number of a capturing group
yes Specifies the pattern to match if name/number is matched
no (optional) Specifies the optional pattern to match if name/number is not matched



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 375 / . Delta: 0.03802 с