topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 19, 2024, 7:06 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Launching URL files stored in the Windows file system  (Read 12222 times)

mostlytyping

  • Supporting Member
  • Joined in 2015
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #25 on: July 15, 2017, 01:28 AM »
That is best solved by changing the regex from nn(.*) to ^nn(.*) so that it only matches if the nn is at the START of the string.
Thank you. I was going go respond that in my case I don't actually want the anchor as often I am remembering a fragment of the name of the URL that could be anywhere in the string.
E.g. to find "Learning Elisp for better Emacs" I might simply type "elisp".

However, having tried it, it works, which seems to run counter to what I know about regexes...

EDIT: Wrong again, I am actually using "nn(^.*)" rather than "^nn(.*)" but this "nn(^.*)" still seems to get me the behaviour I want?

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #26 on: July 15, 2017, 08:55 AM »
Screenshot - 7_15_2017 , 9_51_34 AM.png
Screenshot - 7_15_2017 , 9_52_01 AM.png

Difference in the parsing (using RegexBuddy - I have to work with RegEx too much not to have a powerful parser.  Highly recommend it if you work with Regex)

Notice where the root is parsed. The expression is rooted, not the literal.  Not sure what Regex engine mouser is using, but you're correct- it shouldn't be working, because the inner portion should never satisfy that it's at the beginning of the string.  And it doesn't test right in RegexBuddy.