0

RegEx Samples & Naming Standards

Are there any examples of Regular Expressions being used in Virtual Views?

Since there are various RegEx standards and since the way the asset selectors work isn't always obvious, I'd love to see some worked examples of common view RegEx expressions.

I might be blind, but I couldn't see anything like that in the online View documentation.

Also, I'm curious - most of the examples use periods (.) between the elements of a points name. This is very readable, but it's a bit chaotic when writing RegExes, since periods have meaning in regular expressions that completely threw me for quite some time.

For example, I have points that look like 'Site.System.Piece.Name.Temperature'. I was wanted to make an asset up-to but NOT including 'Temperature'. Site.System.Piece wasn't enough - but of course, Site.System.Piece.(.+$). doesn't work. the final expression was actually Site\.System\.Piece\.(.+)\., which is a little awkward.

Should 'best practice' be to use underscores, to help avoid confusion between literal periods and the RegEx symbol for 'any character'?

1 reply

null

Content aside

print this pagePrint this page
  • 2 mths agoLast active
  • 1Replies
  • 45Views
  • 2 Following