Regex

Using Subexpressions in RegEx

We need subexpressions for complex and refined output. We can refine our output by grouping the expressions.  E.g. Test Case – HelloHello  RegEx – Hello{2,} Result – Hello{2,} It will not match any Hello because above expression is finding 'Hell' and atleast two occurence of 'o'. So, we need to create Read more…

By faltutech, ago
Regex

Position Matching RegEx

Using Boundaries : Position matching is used to specify where within a string of text a match should occur.  To understand the need for position matching,consider the following example: TEXT The cat scattered his food all over the room. REGEX cat RESULT The cat scattered his food all over the Read more…

By faltutech, ago
Regex

Using Metacharacters in RegEx

Escaping : Metacharacters are characters that have special meaning within regular expressions. The period (.) is a metacharacter; it is usedto match any single character. Similarly, the left bracket ([) is a metacharacter; it is used to mark the beginning of a set. Because metacharacters take on special significance when Read more…

By faltutech, ago
Regex

Matching Sets of Characters (RegEx)

Matching One of Several Characters As you have learned previously, . matches any one character (as does any literal character). But what if there was a file (containing Canadian sales data) named ca1.xls as well with na1.xls and sa1.xls, and you only wanted to match only na and sa?. would also match c,and Read more…

By faltutech, ago
Regex

Introduction to Regular Expressions (Regex)

Regular expressions and the regular expression language have been around for many years. Regular expression experts have long been armed with an incredibly powerful tool, one that can be used to perform all sorts of powerful text processing and manipulation in just about every language and on every platform. What Read more…

By faltutech, ago