![]() |
#16 |
Enthusiast
![]() Posts: 40
Karma: 10
Join Date: Jul 2015
Device: none
|
Btw, ive had a need to use escapes with some regex searches, and wondering if the way to describe escapes is like saying "treat the next character as plain text, rather than regular expression" because using (.*?) or (\d+) whenever square brackets are present like <span>[page (.*?)]</span> or <span>[page (\d+)]</span> doesnt work, but adding backslashes before each square bracket like <span>\[page (.*?)\]</span> does
Last edited by ni_c; 10-04-2015 at 06:53 AM. |
![]() |
![]() |
![]() |
#17 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,076
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:
[ ] is a 'set', ( ) is a group dot, asterisk, question mark or slash Grab yourself a 'Cheatography' REGEX Quick reference guide and keep it handy. Just remember that not everything shown works will our REGEX variant. |
|
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
@ni_c,
Correct. See: http://www.regular-expressions.info/characters.html Brackets are special characters, which say "treat everything in between as a character set, and match on any". Escaping with a backslash turns them into literal (plain old text) brackets. Last edited by eschwartz; 10-04-2015 at 11:41 AM. |
![]() |
![]() |
![]() |
#19 |
Enthusiast
![]() Posts: 40
Karma: 10
Join Date: Jul 2015
Device: none
|
thanks and thanks, that cheatography will help
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search and replace question (regular expression) | Funslinger | Library Management | 2 | 06-21-2013 02:12 AM |
Help with regular expression search/replace | bfollowell | Sigil | 12 | 06-20-2013 07:36 PM |
How to obtain a new page for every chapter in regular expression (search/replace)? | Ravenik | Conversion | 2 | 05-24-2012 07:04 AM |
Search & Replace - Regular expression | oldbwl | Calibre | 2 | 01-09-2011 09:33 AM |
Find/Replace with regular expression | hydrolith | Sigil | 6 | 03-01-2010 08:42 PM |