Jump to content

Please read the Forum Rules before posting.

Photo
- - - - -

REGEX question


4 replies to this topic

#1 resurrection2016

resurrection2016

    Liking e-Sword

  • Veterans
  • PipPip
  • 17 posts
Offline

Posted 14 July 2012 - 02:27 PM

Maybe I missed it in the REGEX section of the tutorial, and maybe I missed it cursorially searching the forums for an answer, but I'm wondering how to do a REGEX search for any plural/possessive/hyphenated, etc. forms of the root string that DO NOT include the root string. For example:

"God's"
"Gods"
"God-...."

But NOT "God".

Thanks.

#2 JPG

JPG

    Jon.

  • Moderators
  • 1,678 posts
Online

Posted 14 July 2012 - 03:01 PM

You could try something like this, but I notice that the italic God is matched (possible issue)

God(?![?! ,.;: ]+)[^ ]+

#3 resurrection2016

resurrection2016

    Liking e-Sword

  • Veterans
  • PipPip
  • 17 posts
Offline

Posted 14 July 2012 - 03:23 PM

Thank you. That did seem to work. Can you explain why?

#4 resurrection2016

resurrection2016

    Liking e-Sword

  • Veterans
  • PipPip
  • 17 posts
Offline

Posted 15 July 2012 - 04:45 AM

Anyone? Why does this work?

#5 JPG

JPG

    Jon.

  • Moderators
  • 1,678 posts
Online

Posted 15 July 2012 - 07:03 AM

Anyone? Why does this work?


You would need to study how regular expressions work to understand it. There is a section in the User Guide, that comes with e-Sword. Also there is a great source of info here http://www.regular-expressions.info/

Jon

Don't know why I did it that way. I suppose easier would be a positive lookahead, so it is looking for God followed by an apostrophe or hyphen or a to z any amount of times.
God(?=['a-z-]+)

This is better as it does not hit the italics God


After some developer feedback, I now understand that the first regex is encountering some rtf code {\cf15\i God} where the grey Italic is used. So for instance if you tried to search doth any which is found at Jer 51:43 you would have to use this doth \{\\cf15\\i any to find it with a regex.!!!! eeek

Edited by JPG, 15 July 2012 - 01:50 PM.




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users




Similar Topics



Latest Blogs