Author Topic: Regular Expressions  (Read 5094 times)

Felix66

  • Guest
Hi!

What about adding support for searching and/or replacing tag content by using regular expressions? I think this would be a powerful feature to add to MusicBee.

(The regex classes located in the namespace System.Text.RegularExpressions might do the trick?)

br/felix

Debby747

  • Guest
+1
I've just finished my lecture of "Regular Expressions in 10 Minutes" (Ben Forta) :-)

Greetings
D.


Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34364
its a simple change for the search & replace function, so i've done this for the next update
its not in the auto-playlists filter criteria though
Last Edit: September 19, 2010, 12:19:10 PM by Steven

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34364
actually its quite straight forward for auto-playlists/ filters so its done for that as well

you might want to check out for the syntax:
http://msdn.microsoft.com/en-us/library/az24scfc.aspx

as it isnt exactly the same as what i know to be standard eg. it doesnt support /i in the expression and requires a different api call (hence i've created 2 Regx searches, one case sensitive and another case insensitive)
Last Edit: September 19, 2010, 01:10:31 PM by Steven

Felix66

  • Guest
Hi, Steven!

It seems to work as intended! Thanks!  :)

Might I suggest that regular expressions would be included in the Find dialogue, the Custom Search dialogue and the Auto Playlist dialogue as well?

Best regards

Felix


Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34364
yes they already are - for any string field these should be in the drop-down match types:
"match RegEx"
"match RegEx/i"

Felix66

  • Guest
Great!   :)

Thanks, Steven!

Best Regards

Felix

raffraffraff

  • Newbie
  • *
  • Posts: 9
Greetings.
I'm a very recent convert (coming from Linux/Amarok) and I absolutely love MusicBee so far. On the RegEx, I noticed (in the latest beta release anyway) that it's impossible to use RegEx with the Genre field - it still just gives me a drop-down menu list of Genres instead of a field where I can put my regular expression.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34364