3SL: Requirements management and model driven systems engineering from concept to creation.
Cradle®
Login:
Username:
Password:
 
Search:  
Visitor not logged in, You are: Home > News > 3SL web based newsletter
 

 

3SL Web-based newsletter for November 2007 [Cradle 5.6]

Regular Expressions in Queries

One of the most common uses for regular expressions is in queries, particularly when finding items based on the values of their category codes.

In the Query Details dialogue, the Categories tab is used to select items based on the value(s) of their categories:

You can select items by entering a search expression into any of these fields. A search expression is a comma separated list of regular expressions, each of which may be preceded by an optional ! character, meaning NOT. Each of the commas should be interpreted as an OR.

So a simple search expression would be:

Approve

which would find all items whose value for the category contains the string Approved, such as items with category values:

Approved

Approved with Changes

If you want to find items whose category value is precisely Approved, then your regular expression must match all of the item’s category value, and so it would be:

^Approved$

If you want to find items whose category value contains Approved or Rejected, then your search expression would be:

Approved,Rejected

You can include spaces around regular expressions in the search expression to improve readability without affecting the search, so this search expression could also be entered:

Approved , Rejected

and still have the same result.

To find items whose category value contains neither Approved nor Rejected, then your search expression would be:

! Approved, ! Rejected

in which the extra spaces are ignored, as before.

Combining all of the above, if you want to find items whose category values are not exactly Approved nor exactly Rejected, then your search expression would be:

! ^Approved$, ! ^Rejected$

Back to index

 
 
[Copyright © 3SL 2008 | Last Updated: Sat Jul 19th, 2008 ]
Registered office: 2 Highfield Road, Barrow in Furness, Cumbria, LA14 5PA, Registered in England No. 2153654