Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-20-2011, 07:02 PM   #16
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
*nods* - my post not intended as any comment on yours, Perkin - when I started typing, your post wasn't there - I got interrupted and came back, finished my post, then when I posted it, yours was already there.
DMSmillie is offline   Reply With Quote
Old 03-20-2011, 07:31 PM   #17
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16078357
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by Perkin View Post
@DMSmillie, the site I linked to was also done by the same team who done EditPadPro, RegexBuddy (and others)
I love the JGSoft tools and have been using them for many years, mostly in other programming. I use EditPadPro, RegexBuddy (aka Regex For Dummies) and PowerGREP. Like the lady says, not free but worth the low costs charged).

If Sigil used them we'd have the most powerful eBook editor known to mankind.
crutledge is offline   Reply With Quote
Advert
Old 03-20-2011, 08:13 PM   #18
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 697
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by Jabby View Post
Can anybody point me to a book or tutorial that uses specific examples to explain Regex? I have found quite a few tutorials that do this for the search function, but none for the the replace string.

Thanks and regards - John

P.S. Long, long ago, in a place far away, I wrote, as we called them then, a "string processor" for the PDP-8. I do understand the concept - its the syntax that befuddles me.
Hi, Jabby, and welcome!

If you go back to PDP-8's, you go back as far as I do! You can google "man perlre" and find the man pages for the PERL dialect of regex, which IMHO gives a fairly concise yet readable description. (The PERL dialect seems to come closest to what's used in Sigil.)
st_albert is offline   Reply With Quote
Old 03-20-2011, 09:06 PM   #19
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Quote:
Originally Posted by DMSmillie View Post
*nods* - my post not intended as any comment on yours, Perkin - when I started typing, your post wasn't there - I got interrupted and came back, finished my post, then when I posted it, yours was already there.
I realised that, just pointing out that the site was also from the JGsoft team.
Perkin is offline   Reply With Quote
Old 03-20-2011, 10:29 PM   #20
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
My thanks to all who pitched in to help.

I think I understand the answers to my question. I still need to think about where the "\2" fits in (I understand, not in this case).

I've bookmarked the tutorial sites and will study these and then probably buy RegexBuddy;

Again thanks. Regards - John

P.S. The ranks of those who have worked with the PDP-8 are starting to thin. I haven't fiddled with one for almost fifty years. Ye gods! That makes me feel old.
Jabby is offline   Reply With Quote
Advert
Old 03-20-2011, 10:35 PM   #21
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,048
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Jabby View Post
My thanks to all who pitched in to help.

I think I understand the answers to my question. I still need to think about where the "\2" fits in (I understand, not in this case).

I've bookmarked the tutorial sites and will study these and then probably buy RegexBuddy;

Again thanks. Regards - John

P.S. The ranks of those who have worked with the PDP-8 are starting to thin. I haven't fiddled with one for almost fifty years. Ye gods! That makes me feel old.
Lastname, Firstname -> Firstname Lastname

Search: (\w+), (\w+)
Replace: \2 \1


toggle toggle Deposit
theducks is online now   Reply With Quote
Old 03-21-2011, 11:34 AM   #22
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
Quote:
Originally Posted by theducks View Post
Lastname, Firstname -> Firstname Lastname

Search: (\w+), (\w+)
Replace: \2 \1


toggle toggle Deposit
Bingo; and thanks - John
Jabby is offline   Reply With Quote
Old 03-21-2011, 01:30 PM   #23
Faster
Connoisseur
Faster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of light
 
Posts: 61
Karma: 12096
Join Date: Sep 2010
Location: Tasmania
Device: Sony PRS 650
Interesting discussion.
Why use .* instead of .+
Answer: because * looks for zero or more whilst + looks for one or more. If two underlines occurred next to each other they would not be found. Could that occur? Yes, because the italicized word was deleted at some stage but not the tags.

It is worth noting that MS Word has an option to change the underline bracketed text to italic. Go to Format - AutoFormat - Options, or go to Tools - AutoCorrect Options - AutoFormat As You Type. It also deals with *words here* changed to bold.

Concerning back referencing, you can also use a back reference in the Find box:
Code:
_(.*)_
could be written as:
Code:
(_)(.*)\1
and the Replace expression would be:
Code:
\2
As for flavours of Regex - couldn't agree more about the confusion it causes. The worst aspect to me is the limitations as to what can be used in the Replace box.
Faster is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Increase search and replace? user_none Conversion 24 04-08-2011 03:59 PM
search and replace - drops blanks in replace ? cybmole Conversion 10 03-13-2011 03:07 AM
macro - Search and Replace oldbwl Workshop 17 03-05-2011 01:39 PM
Search and replace in 0.2.0 paulpeer Sigil 7 03-13-2010 11:59 AM
Why no search and replace? charleski Sigil 10 11-24-2009 04:13 PM


All times are GMT -4. The time now is 06:27 PM.


MobileRead.com is a privately owned, operated and funded community.