Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • July 23, 2017, 09:52:35 PM
  • Proudly celebrating 10 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 1055 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:27 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
  • **
  • Posts: 8,839
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #26 on: July 15, 2017, 08:55:40 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.