pyads icon indicating copy to clipboard operation
pyads copied to clipboard

Feature: Expose AmsAddress.RegularExpressionPattern

Open rerpha opened this issue 3 years ago • 2 comments

I would like to validate my AMS addresses against https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_adsnetref/7313118347.html&id= and use pyads for it rather than copy it in and modify to work in python. Perhaps it could live in constants?

rerpha avatar Feb 07 '22 10:02 rerpha

The netid object currently throws a ValueError when the net ID is not valid, when creating a Connection for instance. This is not based on a regex exactly, but a check for 5 periods and whether each group is numeric.

So you could try ... catch in your application.

I don't think we need to expose a regex like this.

RobertoRoos avatar Oct 13 '22 14:10 RobertoRoos

my use case was offline validating, rather than creating a connection, and I was thinking as pyads is effectively a DLL wrapper/abstraction it might be handy to have it included in constants

rerpha avatar Oct 13 '22 14:10 rerpha