INTERACT FORUM

Please login or register.

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

Author Topic: Regex() expression language section ready for review...  (Read 9235 times)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Regex() expression language section ready for review...
« Reply #50 on: September 12, 2011, 12:08:18 pm »

So a word character can be digit? Strange. I wondered why your previous RE worked as regards numbers in the beginning.

Yeah, a "word" in this space was defined to mirror allowable characters for computer program variables - alpha-numeric's plus underscore.  The developers were folks doing a lot of textual processing of computer program code (for documentation), so a \w was defined to abbreviate the oft-written RE segment to match computer program variable names and identifiers.
Logged
The opinions I express represent my own folly.

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42029
  • Shoes gone again!
Re: Regex() expression language section ready for review...
« Reply #51 on: September 12, 2011, 12:23:35 pm »

The expression engine is the Microsoft TR1 engine:
http://msdn.microsoft.com/en-us/library/bb982727.aspx


Why not keep it as simple as possible?

regex(if(regex([Artist],
     /#^[\[("](.*)?[\])"]+(.*)$#/, 0),
       [R1][R2], [Artist]),
  /#^[^\w\d?]*(.*)$#/, 1)

You know you're too smart if you preface that with 'simple' :P
Logged
Matt Ashland, JRiver Media Center

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Regex() expression language section ready for review...
« Reply #52 on: September 13, 2011, 05:38:01 am »

Thanks for the info! MrC had already figured out the engine.

With global replace implemented I could substitute all references to "simple" with something more appropriate... :D
Logged
Pages: 1 [2]   Go Up