PxPlus User Forum

Twitter Twitter Twitter

Author Topic: web/ftp regex question  (Read 1891 times)

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
web/ftp regex question
« on: April 14, 2020, 07:32:46 PM »
We have been using the web/ftp with the regex option in an INVOKE command.
With simple *.extn  and *.* it works.
There is now a need for using more complex regex and I am not having success returning files.
Version is 14.00 PxPlus.

For instance, in web/ftp
*.gfs|B0M works as a mask in web/ftp but not in PxPlus
^g[0-9]{6}c313260[0-9]*\.gfs|B0M does not work as a mask in web/ftp but works great in PxPlus.
I have tried putting the -'OM'=0 in the invoke statement which has no affect.
Can anyone explain how this works in web/ftp?

Example with an actual file name.
0001 msk$="^g[0-9]{6}c313260[0-9]*\.gfs"  ! "|(^g[0-9]+c313260[0-9]*\.gfs)"
0002 x$="g200410c31326001000000000322285095.gfs"
0003 PRINT MSK(x$,msk$)
0004 PRINT MSL
-;run
 1
 38
-;

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: web/ftp regex question
« Reply #1 on: April 15, 2020, 08:12:42 AM »
PxPlus 2014 does not support the M option (MSK( ) regular expression pattern matching) in *web/ftp. That ability was added in PxPlus 2016 update 0001.
Principal Software Engineer for PVX Plus Technologies LTD.

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
Re: web/ftp regex question
« Reply #2 on: April 15, 2020, 10:35:45 AM »
Thanks Devon, 

Shades of Manifest.  I seem to have lost 3 years.  :o
Are we discussing this year's Direxions version for implementing the msk?

PxPlus-2019 Web (Ver:16.10/MS-WINDOWS) Serno:1610-001-
(c) Copyright 2005-2018 PVX Plus Technologies Ltd. (All rights reserved)
  Website: http://www.pvxplus.com
->?ssn
1610-001-
->

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: web/ftp regex question
« Reply #3 on: April 15, 2020, 10:43:08 AM »
*web/ftp was enhanced to support full regular expressions using the M option starting with PxPlus 2016 update 0001. All versions released after that also had this enhanced version of *web/ftp.

PxPlus 2019 is newer then PxPlus 2016 so it will have the version of *web/ftp that supports regular expressions via the M option.
Principal Software Engineer for PVX Plus Technologies LTD.

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
Re: web/ftp regex question
« Reply #4 on: April 15, 2020, 11:18:25 AM »
Devon,

This is the version in use.  Should it support MSK in web/ftp?

PxPlus-2017 Pro (Ver:14.00/UNIX-Linux-RedHat) Serno:1400-664-
(c) Copyright 2005-2017 PVX Plus Technologies Ltd. (All rights reserved)
  Website: http://www.pvxplus.com
->

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: web/ftp regex question
« Reply #5 on: April 15, 2020, 11:53:39 AM »
Yes PxPlus 2017 should support *web/ftp regular expression via the M option.

Sorry when you said originally you were using version 14 my brain interpreted that as PxPlus 2014.
Principal Software Engineer for PVX Plus Technologies LTD.

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
Re: web/ftp regex question
« Reply #6 on: April 15, 2020, 01:00:22 PM »
Devon,
Understandable.  What if anything can I do to debug this.   This program is encrypted. 
Do you know if the msk is applied in Curl or in the program itself?


Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: web/ftp regex question
« Reply #7 on: April 15, 2020, 02:14:37 PM »
The MSK() happens in the PxPlus program.

I think your problem may be that you include ^ at the start of your pattern. The pattern as passed into *web/ftp is automatically put between a ^ and a $ to ensure only whole matches return true.

If you remove the ^ from your pattern it should work.
Principal Software Engineer for PVX Plus Technologies LTD.

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
Re: web/ftp regex question
« Reply #8 on: April 15, 2020, 02:58:22 PM »
Thanks Devon,
You are right.  Works great without the ^$
I'll sub those out in the Filter setup field validation and we are good to go. 
Have a terrific day.