JADE Environment Development Ideas

What's new in the upcoming JADE release?

IMPROVED DEVELOPER EFFICIENCY. ENHANCED SECURITY. SMOOTHER INTEGRATION

The JADE 2022 release meets tomorrow’s business demands.


Start your update to JADE's latest release

Regular Expression Support

Overview

The proposal is to provide a Pattern Matching API be added to the JADE product. This would be provided as a set of JADE classes.

Objective

A key objective of the proposal is:

  • To make it easier for developers by reducing the amount of hand rolled string parsing and manipulation code.

  • To provide powerful and useful utility methods based on standard pattern matching techniques.

  • Allow developers to leverage standard patterns such as for email validation.

  • Use of this feature should improve the long-term read-ability and test-ability of JADE code.

Feature Summary

  • Pattern based Find e.g finding a number e.g 3.14

  • Pattern based Match e.g check that a credit card number is of the correct format

  • Pattern based Splitting e.g splitting a string based on a set of delimiters or pattern

  • Pattern based Replacing e.g. replacing \\\\ with // in a directory path

  • Access to captured groups, if required

  • Case and case insensitive capability, for when case matters

  • Word boundary and other regex anchors

  • Multiple line operations for large bodies of text

  • API support for returning first only or all occurrences from an operation

  • Work with both ANSI and Unicode versions of JADE

  • Probably based on the PCRE library dialect

Proposed JADE API

A double API is proposed:

First a simple Type Method based one for one off simple operations

JadeRegex@isMatch( text:String; pattern:String; ignoreCase:Boolean; options:Integer64):Boolean;
e.g. isDecimal := JadeRegex@isMatch("3.14", "\\d+\\.d+", false, Option_None);

A second fuller one requiring more programming overhead for repeated and complicated operations

JadeRegexPattern::compile(pattern:String; ignoreCase:Boolean; options:Integer64);
JadeRegexPattern::isMatch( text:String):Boolean;
e.g.
regexPattern : RegexPattern;
create regexPattern;
regexPattern.compile("\\d+\\.d+", false, Option_None);
isDecimal := regexPattern.isMatch("100.0");

New Classes

The JADE Regex Library shall consist of several RootSchema classes.

JadeRegex: Simple Type method only API

JadeRegexPattern: A compiled regex pattern

JadeRegexResult: An iterable result of matches, essentially an array of match tuples

JadeRegexMatch: An individual match tuple giving rich information about a match.
Has properties: value, length, position, index.

JadeRegexCapture: An individual capture group tuple giving rich information about a capture, effectively a sub-match. Has properties: value, length, position, index.

  • Ashley Bass
  • Aug 13 2019
  • Shipped (2020)
  • Attach files
  • Iryna Melnyk commented
    September 02, 2020 09:10

    Regex Demo is available here.