INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Are MC19 regexps compatible with previous versions?  (Read 2155 times)

chrisjj

  • Citizen of the Universe
  • *****
  • Posts: 750
Are MC19 regexps compatible with previous versions?
« on: January 19, 2014, 06:04:15 pm »

Having seen http://wiki.jriver.com/index.php/Expression_Language#Regex

Quote
The regular expression implementation used prior to Media Center 19 is the Microsoft 2010 TR1 engine, and in Media Center 19 it is the Boost engine.

I'd like to know: Are MC19 regexp's compatible with previous versions'? Or will I have to adjust the regexp's in e.g. Calcualted Data field expressions?

Thanks.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Are MC19 regexps compatible with previous versions?
« Reply #1 on: January 19, 2014, 06:54:50 pm »

MC19 now uses Boost regular expressions.  They should generally be a superset of the previously-used Microsoft TR1 expressions.  I haven't done a thorough survey though.  Nor have to bothered yet to figure out which Boost flavor are being used.

If someone with source code access can tell me which flavor / variant is being used, that would be useful.
Logged
The opinions I express represent my own folly.

chrisjj

  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Are MC19 regexps compatible with previous versions?
« Reply #2 on: January 19, 2014, 07:08:10 pm »

Thanks MrC. If there's any official documentation about the switch of regexp engine, I'd be interested to see it. I've found only that mention in the wiki.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Are MC19 regexps compatible with previous versions?
« Reply #3 on: January 19, 2014, 07:12:06 pm »

I've only seen it here:

Quote
19.0.46 (9/26/2013)
1. First build of MC19 for Mac.
2. Changed: Uses the Boost library for regular expressions which is more powerful than the previously used Posix library.

But Matt and I had offline conversations about this a while back, so that's how I knew something had or was going to change.  It was clear JRiver would need to change with the announcement of the Mac and Linux ports, so I had wondered what they were going to use, and asked Matt.  There was an initial POSIX library used for the Mac, but I noticed some issues, and I think the plan was all along to use the same library.  Boost is very good.
Logged
The opinions I express represent my own folly.

chrisjj

  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Are MC19 regexps compatible with previous versions?
« Reply #4 on: January 20, 2014, 08:16:12 am »

MrC, I created a wiki page http://wiki.jriver.com/index.php/Regular_expression_syntax containing info known, for further info to be added as it is discovered.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13875
Re: Are MC19 regexps compatible with previous versions?
« Reply #5 on: January 20, 2014, 09:22:00 am »

MC19 now uses Boost regular expressions.  They should generally be a superset of the previously-used Microsoft TR1 expressions.  I haven't done a thorough survey though.  Nor have to bothered yet to figure out which Boost flavor are being used.

If someone with source code access can tell me which flavor / variant is being used, that would be useful.

Version 1.54, the same across all platforms.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Are MC19 regexps compatible with previous versions?
« Reply #6 on: January 20, 2014, 09:39:03 am »

Added it to the wiki, and fixed the spelling of Media Center (this, here's, 'Merica).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Are MC19 regexps compatible with previous versions?
« Reply #7 on: January 20, 2014, 12:19:11 pm »

Version 1.54, the same across all platforms.

Thanks Bob.

Are you passing any flags (e.g. boost::regex::extended or boost::regex::basic) to the constructors to force a particular syntax (or setting these in another means), or is perl (the default) syntax being used?

MrC, I created a wiki page http://wiki.jriver.com/index.php/Regular_expression_syntax containing info known, for further info to be added as it is discovered.

Ok, cool.  Please understand that within MC's Regex() function, only one regex flavor is supported; MC users cannot set the flavor flag.  It would be easy enough to discover through a few judicious tests, but maybe bob can relay the info easily enough.

I'd do away with the "reported to be" type of statements, and just say what it is.  Anything and everything we write is based on what we believe, and until or unless demonstrated otherwise, with good enough authority (Matt, for instance) we can take it as fact.  The Wiki shouldn't be a news story with lots of CYA's.

Also, keep in mind who the target audience is - this audience is likely not to care about the list of shortcomings or implementations differences between RE implementations.  They are not regex library users.   Compatibility failures for implementers (vs. issues for end users of the already-implemented) are not useful here, because MC users cannot set flavor and other flags.  It would be better to create your own list with tests and workarounds as you find them between TR1 and Boost as MC employs them.
Logged
The opinions I express represent my own folly.

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13875
Re: Are MC19 regexps compatible with previous versions?
« Reply #8 on: January 20, 2014, 12:37:10 pm »

Thanks Bob.

Are you passing any flags (e.g. boost::regex::extended or boost::regex::basic) to the constructors to force a particular syntax (or setting these in another means), or is perl (the default) syntax being used?

Ok, cool.  Please understand that within MC's Regex() function, only one regex flavor is supported; MC users cannot set the flavor flag.  It would be easy enough to discover through a few judicious tests, but maybe bob can relay the info easily enough.

...
We don't seem to be passing any flags.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Are MC19 regexps compatible with previous versions?
« Reply #9 on: January 20, 2014, 12:51:18 pm »

Ok, great, thank you.  We'll assume flavor = perl.

Let's see if chrisjj can devise some tests that demonstrate to his satisfaction the implied flavor.
Logged
The opinions I express represent my own folly.

chrisjj

  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Are MC19 regexps compatible with previous versions?
« Reply #10 on: January 20, 2014, 04:03:36 pm »

I'd do away with the "reported to be" type of statements, and just say what it is.

I'd love to, but I don't know what it is. If you do, be my guest :)

Also, keep in mind who the target audience is - this audience is likely not to care about the list of shortcomings or implementations differences between RE implementations.

The audience I was keeping in mind does include users interested in the shortcomings and implementation differences.

Compatibility failures for implementers (vs. issues for end users of the already-implemented) are not useful here, because MC users cannot set flavor and other flags.

Such compatibility failures very much affect users, regardless of inability to set flags.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Are MC19 regexps compatible with previous versions?
« Reply #11 on: January 20, 2014, 04:14:45 pm »

Unless you've actually tested MC versions to verify your linked "shortcoming" actually is relevant, the reference is not useful.  You've found some link to some guys discussing an issue with a regex REPLACE operation, one that MC does not implement.  In other words, that discussion has no relevance in MC at all.
Logged
The opinions I express represent my own folly.

chrisjj

  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Are MC19 regexps compatible with previous versions?
« Reply #12 on: January 20, 2014, 06:29:12 pm »

Let's see if chrisjj can devise some tests that demonstrate to his satisfaction the implied flavor.

Am I that predictable?? :)

Here's my test expression: regex(+,/#(\Q+\E)#/,1)

On regex Perl syntax, it matches: http://img202.imageshack.us/img202/8463/tmli.png

On regex POSIX syntax, it does not match: http://img839.imageshack.us/img839/1585/ftcf.png

On MC19, it does match: http://img819.imageshack.us/img819/6154/4c0i.png

Since MC19's Boost regexp offers only Perl syntax or POSIX syntax, the above result shows it is Perl syntax.
Logged
Pages: [1]   Go Up