Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-13-2018, 05:01 AM   #1
iron_sigil
Junior Member
iron_sigil began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2018
Device: Samsung
Basic use of Regex, for a beginner

Hello there, this is my first post. I'm writing from Italy and here is my problem with Sigil x Windows (a good app anyway).
Is there anyone of help to solve this issue?
When I copy into Sigil some text (from Wikipedia for example) there are notes such as [1], [2] etc. Then I try to eliminate them fully with the function regex but the square brackets won't go away. I've tried different options but couldn't find the right way. For example I've typed [0-9]+ and only the numbers are deleted then I have to go to normal search/replace and I can delete first the close square bracket ] and then the open one[.
Can anyone Thanks a million!
Franco
iron_sigil is offline   Reply With Quote
Old 10-13-2018, 05:09 AM   #2
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Try Search:
Code:
\[\d+\]
or, if you prefer
Code:
\[[0-9]+\]
Square brackets are special characters in Regex so they need to be 'escaped' by prefixing them with a backslash character
jackie_w is offline   Reply With Quote
Old 10-20-2018, 05:25 PM   #3
iron_sigil
Junior Member
iron_sigil began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2018
Device: Samsung
Reply an one more (last)

Quote:
Originally Posted by jackie_w View Post
Try Search:
Code:
\[\d+\]
or, if you prefer
Code:
\[[0-9]+\]
Square brackets are special characters in Regex so they need to be 'escaped' by prefixing them with a backslash character
Oh, it works!! Thanks a lot, Jackie. I did not know about the 'escapism' to apply. Very smart.
One more thing and I hope the last one:
which code do I have to use to eliminate for example [a], [b], [c], etc always inside square brackets?
Thanks in advance
Franco
iron_sigil is offline   Reply With Quote
Old 10-20-2018, 05:45 PM   #4
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by iron_sigil View Post
which code do I have to use to eliminate for example [a], [b], [c], etc always inside square brackets?
Search: \[[a-z]\]

The Blue section tells Regex to "look for single lowercase a through z".

Note: [] are special characters in Regex to tell it "look for these specific characters in this position".

Red parts say "look for a left bracket" + "look for a right bracket".

Note: Because [] are special characters, you have to use the \ before them in order to find the ACTUAL bracket characters in your text.

Note 2: Other special characters in Regex are ?+.{}\.
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen background color 2014 Kindle basic vs 2013 basic bounce Amazon Kindle 1 01-08-2015 03:50 PM
basic beginner questions epub to kf8 xmlgirl Kindle Formats 3 11-07-2012 05:33 PM
REALLY basic, basic, basic questions MrB Amazon Kindle 3 10-22-2012 06:43 AM
Beginner Isa Palavarti Introduce Yourself 3 07-22-2011 06:02 PM


All times are GMT -4. The time now is 12:49 PM.


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