Regexp - (Flag|Modifier)

Regexp

Regexp - (Flag|Modifier)

About

Flag or modifier changes the behavior of the parsing and therefore of the match.

List

dotall / g

A dot may matches new line or not. You specify it by specifying a flag.

Java Example with the DOTALL flag:

  • A pattern that capture the content between two XML nodes even if there is new line in there.
Pattern pattern = Pattern.compile("<top>(.*?)</top>",Pattern.DOTALL);

i

the i flag will perform a case insensitive match.

Disable

If you don't have access to the regular expression compiler, you may be able to disable a flag in the regular expression with the following syntax

(?-flag)expression

To disable the multi-line flag (m), you would type:

(?-m)expression

Documentation / Reference





Discover More
Javascript - String

The in javascript. A string in JavaScript is encoded with the ucs-2 16-bit character set. An element of a JavaScript string is therefore a 16-bit code unit. code unitscode pointssurrogate pair Strings...
Regexp
Multilingual Regular Expression Syntax (Pattern)

Regular expression are Expressions that defines a pattern (ie structure) in text. This is therefore a language that permits to define structure of a text. They are a mathematically-defined concept, invented...
Card Puncher Data Processing
Php - Regular expressions (Perl-compatible)

in Php are an implementation of Perl (PCRE) with the PCRE library (See ). Therefore, the syntax for patterns used in these functions closely resembles to Perl (PCRE) but not totally. See reference.pcre.pattern.differencesPerl...
Regexp
Regexp - Dot (Single Character pattern)

Dot . in a regular expression matches any character in the supported character set with this characteristic, by default: newline characters are not included without setting a flag. See matchnewline...
Regexp
Regular Expression - Group (Capture|Substitution)

group are regexp expression that captures by default the match. You can then (extract|reference) the match content. Look-aroundgroups The below regular expression has two groups where: the first...



Share this page:
Follow us:
Task Runner