11-30-2010, 06:02 PM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Nov 2010
Device: ipad
|
how to have regex dot match any character including newline?
Hi all,
I am trying to trim a footer that keeps mutating itself via the conversion process to include a variable number of characters and breaklines. How can I setup my regular expression to have the dot character including any character which includes newline characters? Thanks! |
11-30-2010, 06:09 PM | #2 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
put this at the very beginning of your regex:
Code:
(?s) |
Advert | |
|
11-30-2010, 06:17 PM | #3 |
Junior Member
Posts: 9
Karma: 10
Join Date: Nov 2010
Device: ipad
|
thanks for the help!
hmmmm, this seems to be tricky... if I use (?s) all of my text gets selected :P Here are two examples of what I'm trying to match: Code:
<hr> <A name=21></a><i><b>24_</b></i><br> <i>ΤΖ.Κ. ΡΟΟΥΛΙΝΓΚ</i><br> Code:
<hr> <A name=265></a><i>268 ΤΖ. Κ. ΡΟΟΥΛΙΝΓΚ</i><br> Code:
<hr>\s+.*ΡΟΟΥΛΙΝΓΚ.*<br> |
11-30-2010, 06:19 PM | #4 |
Junior Member
Posts: 9
Karma: 10
Join Date: Nov 2010
Device: ipad
|
this might be the winner:
Code:
<hr>\n+.*\n?.*ΡΟΟΥΛΙΝΓΚ.*<br> |
11-30-2010, 06:22 PM | #5 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Probably best not to use .* - it's way too greedy. Try .*? instead. Even that can sometimes have unintended matches, so be sure to review the whole book's matches.
|
Advert | |
|
11-30-2010, 06:35 PM | #6 |
Junior Member
Posts: 9
Karma: 10
Join Date: Nov 2010
Device: ipad
|
thanks bud! got it worked out
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dot on my kindle (International)? | ensyed | Amazon Kindle | 5 | 12-17-2010 01:33 PM |
regex for character replacement, em-dash questions | cybmole | Calibre | 3 | 10-18-2010 03:09 PM |
Need help with a conversion regex - can't match newline | ereader123 | Calibre | 2 | 03-29-2010 10:58 AM |
Old news: Sony PRS-505 wins international red dot design award - 2008 | Wetdogeared | News | 0 | 06-20-2009 09:51 AM |
Microsoft's latest stunt: On 10 dot net | Alexander Turcic | Lounge | 0 | 03-13-2006 08:06 AM |