LogoLogo
  • LIBSAFE Advanced Pro - Preservation Administrator Manual
  • System configuration
  • Preservation configuration, basic sections
    • Ingestion sanitizers
      • Ingestion sanitizers detail
      • Ingestion sanitizer editing
    • Preprocessors
      • Preprocessor detail
      • Creation of the preprocessor
      • Preprocessor editing
    • Ingestion checks
      • Ingestion check detail
      • Creation of the ingestion check
      • Ingestion check editing
      • Main ingestion checks
    • Metadata filters
      • Metadata filter detail
      • Metadata filter creation
      • Metadata filter editing
    • Dissemination Information Package (DIP) profiles
      • DIP profile detail
      • Creation of DIP profiles
      • DIP profile edition
    • Connectors
      • Connector Activation
      • Connector details
    • File formats
      • File format detail
    • File format characterizers
      • File format characterizer detail
    • File format validators
      • File format validator detail
    • File format evolvers
      • File format evolver detail
    • Automatic audit schemas
      • Automatic audit schema detail
      • Automatic audit schema editing
  • Metadata collision groups
    • Unicity metadata collision groups
      • Unicity metadata collision group detail
      • Creation of a unicity metadata collision group
      • Unicity metadata collision group editing
    • Versioning metadata collision groups
      • Versioning metadata collision group detail
      • Creation of a versioning metadata collision group
      • Versioning metadata collision group editing
  • Metadata schemas
    • Metadata schema detail
    • Creation of a metadata schema
    • Metadata schema editing
  • Collection tree
  • Dissemination Information Package (DIP) configured profiles
    • Detail of the DIP profile configured for preservation plans
    • Configuring a new DIP profile for preservation plans
    • Editing DIP profiles configured for preservation plans
  • Preservation areas
    • Preservation area detail
    • Create a preservation area
    • Preservation area editing
  • Preservation plans
    • Preservation plan detail
    • Preservation plan creation
      • Preservation area and plan parameters
      • Metadata
      • Associated thumbnail
      • Storage
      • Sanitizers
      • Preprocessors
      • Checks
      • File format characterizers
      • File format validators
      • File format transformers
      • Digital signature
      • Rollback
      • Data Integrity
  • Alarms and notifications
    • Alarm definition
    • Configured alarms
      • Configuring an alarm: example 1
      • Configuring an alarm: example 2
    • Notifications panel
  • Glossary of Terms
  • Frequently asked Questions and additional considerations
    • About ingestion and retrieval
    • About audit
    • Miscellaneous
  • Annexes
    • Automatic ingestion and retrieval processes
      • Automatic ingestion
      • Automatic retrieval
    • Regex expressions – User reference
    • List of error messages found in audits (log)
Powered by GitBook
On this page

Was this helpful?

  1. Annexes

Regex expressions – User reference

PreviousAutomatic retrievalNextList of error messages found in audits (log)

Last updated 3 years ago

Was this helpful?

A RegEx expression, or Regular Expression, is a set of characters that make up a search pattern, mainly used for the search of char subchains. Applied to the contents of an object’s file and folder structure, it allows for selecting the files or folders of the object to which to apply a specific action.

RegEx expressions are a standard in the computer world, although there are several variations depending on the field of application. RegEx expressions used in LIBSAFE follow the behavior defined for these expressions in .NET development and production environments. You can find a full reference for them in the MSDN pages , as well as in a large number of web pages.

It is of high importance, or even of critical importance, to pay an extraordinary attention when writing RegEx expressions, as they are strictly applied by the system, and their way of building differs greatly from the use of any other common tool, for an average application user. For those users not fully understanding the use of these expressions, it is recommended that they copy the value for selecting all elements in places where the expressions are needed; this value is available in the accompanying help text in the interface.

Some common errors when writing a RegEx expression: forgetting that patterns are case sensitive by default, misunderstanding that character sequences are not the same as character sets, inserting blank spaces in expressions without realizing that the space becomes part of the chain pattern, ...

It is also important to understand that the general use of RegEx expressions goes far beyond the use that is made of them in the application. Elements such as grouping and self-references are not used by LIBSAFE.

To make it easy to insert expressions, you can find a set of examples hereafter. Beware, that in some occasions there may be more than one pattern to achieve the same result.

Function. Description.

RegEx expression

Select all elements.

This expression will select all objects / folders / files, where applied. It is the one to be used by default, if in doubt of what expression to use.

.*

Select all elements containing a TeXt, case sensitive.

TeXt

Select all elements containing a TEXT, case insensitive.

(?i)text

(?i)TEXT

Select all elements beginning with text, case insensitive.

^(?i)text

Select all elements ending with text, case insensitive.

(?i)text$

Select all elements with an exAct_teXt.

^exAct_teXt$

Select all elements containing the text jpg, ico or tiff, case insensitive. This is a typical example for selecting several folders in one only pattern; as when using the numerical sequence check. It would select folders such as jpg_image, THUMBNAILS_ICO, Tiff or Iconographic (beware that the chain has the subchain ico). See that the use of separation bars | is done with no added spaces.

(?i)(ico|jpg|tiff)

Select all elements that are exactly one of the texts jpg, ico or tiff, case insensitive. See that the use of separation bars | is done with no added spaces.

^(?i)(ico|jpg|tiff)$

Select chains that contain a 4-digit number.

The quantity of desired digits is to be changed at will.

\d{4}

Select chains containing between 3 and 8 digits.

The limits for the number of digits may be changed at will.

\d{3,8}

Select a subchain starting with a text, followed by a 4-digit number, and separated by a _. Case insensitive.

^(?i)text_\d{4}$

From the previous examples, the following operators should be highlighted:

  • ^ -> to indicate the start of the chain.

  • $ -> to indicate the end of the chain.

  • (?i) -> to set case insensitive checking.

https://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx