Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > The == operator

The == operator

The == operator (or its inverse !==) is used for making record selections based on regular expressions. They can therefore enable extremely specific selection criteria, but may also be quite resource-intensive for the database manager.

  1. <BOUCLEx(TABLES){field == expression}>
  2. <BOUCLEx(TABLES){field !== expression}>

Download

Example

Select articles with a title that starts with "The" or "the":

  1. <BOUCLE_arts(ARTICLES){titre == ^[Tt]he}>
  2. - #TITRE<br />
  3. </BOUCLE_arts>

Download

Select article texts that do not contain the word "carnival":

  1. <BOUCLE_arts(ARTICLES){texte !== 'carnival'}>
  2. - #TITRE<br />
  3. </BOUCLE_arts>

Download

Select article texts that do contain the word "carnival", but only if followed by the word "Venice" within 20 characters.

  1. <BOUCLE_arts(ARTICLES){texte == 'carnival.{0,20}Venice'}>
  2. - #TITRE<br />
  3. </BOUCLE_arts>

Download

  • Author :
  • Published :
  • Updated : 30/05/10
  • Translations : English, français