A Geek’s View on Part Numbers

by Oleg on August 17, 2011 · View Comments

I feel a bit geeky today. I posted about part numbers, document number and numbering few times in the past. These posts sparkled an intensive discussion about all possible and impossible data schemas, intelligent numbers and standards for part numbering. I want to give you a bit different approach to think about Part Numbers – Regular Expressions. First of all, what is that? This is how Wikipedia defines regular expressions.

In computing, a regular expression, also referred to as regex or regexp, provides a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. A regular expression is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.

Navigate to the link to the following article - How to use regular expression to search better and save time? Take a moment of time and read it. You will find a lot of interesting tips how you can create various queries that fits your numbering models for documents and parts. The article provides good examples on how to use regular expressions and link to additional resources.

What is the conclusion? I hope you enjoyed my “geeky tips”. Speaking seriously and thinking about practical aspects, regular expressions are good only when your PLM software supports them. Did you get any experience with this in the past? Can you share any examples of regular expression usage in your PDM/PLM software?

Best, Oleg

  • Share/Bookmark
  • Teamcenter allows you to define naming rules for validating part numbers before it will let you create a new part; if the part number entered doesn't pass the naming rules you can't create the part. A naming rule is basically a list of valid patterns consisting of numbers, letters, and literal characters. For example the pattern "XYZ-"nnnnn would allow part numbers XYZ-00001..XYZ-99999. In addition, you also have the ability to express the patterns as regular expressions. Regex's comes in handy when you have fairly wide open part number rules -- for example, if you identify vendor parts by the vendor's part number then you have to have pretty wide open rules to support all the different patterns different vendors may use. You might think you could get away with no naming rules at all in that case, but then you may get weird stuff like leading or trailing white space; "XYX-12345 ". A simple regular expression, [^ ].*[^ ], will solve that problem.

    …but, that still won't solve every potential problem. For example, to the best of my knowledge and ability you can't write a regex that'll allow multiple spaces within a part number so long as there aren't two in a row:
    "abc def ghi" --> pass
    "abc  def  ghi" --> fail

    For that kind of validation I've had to write some code to perform additional validations on the part numbers.

    Scott
    plmdojo.com

  • beyondplm

    Scott, thank you for sharing your experience and practice! This is quite interesting. I had a chance to meet some of the such practices in other PLM systems. A short question - do you have an ability to search based on regex patterns in TeamCenter? Best, Oleg

  • To the best of my knowledge you can't user regex patterns in Teamcenter searches, but there may well be some module or option or third party plug-in out there that will allow it. Generally searches are a thin overlay of the underlying SQL query, so you can use basic wildcards like "*" or "?", but not much more than that.

  • beyondplm

    Scott, Thanks for this note! This is what I thought. SQL is used as the underline query system

blog comments powered by Disqus

Previous post:

Next post: