login Register forgot password or username?
Search:         
Cradle from 3SL, the complete Model Based Systems Engineering Toolsuite, specialising in requirements management, requirements capture, model based systems engineering and for systems engineering software, support and consultancy, the logical choice: Cradle from 3SL.
General request/feedback
NTR Meeting webinar request
GSA schedule
Newsletter archive
Cradle XML documentation
Cradle Security Certificate
Reference

November 2007 [Cradle 5.6.2]

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

In this issue:
  1. 3SL Newsletters
  2. 3SL Website
  3. Need Help?
  4. NASA Cradle User Symposium
  5. REConf 08 Conference
  6. Change to New Item Function
  7. Nested Tables
  8. How to Create Nested Tables
  9. How to Create Multiple Row Views
  10. Regular Expressions
  11. Regular Expressions in Queries
  12. US Price Increase
  13. HP-UX Support
  14. Old Versions of Cradle

Back to the newsletter archive.