|
|
#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! |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123457
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
put this at the very beginning of your regex:
Code:
(?s) |
|
|
|
| Advert | |
|
|
|
|
#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> |
|
|
|
|
|
#4 |
|
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Nov 2010
Device: ipad
|
this might be the winner:
Code:
<hr>\n+.*\n?.*ΡΟΟΥΛΙΝΓΚ.*<br> |
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123457
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 | |
|
|
|
|
#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 02:33 PM |
| regex for character replacement, em-dash questions | cybmole | Calibre | 3 | 10-18-2010 04:09 PM |
| Need help with a conversion regex - can't match newline | ereader123 | Calibre | 2 | 03-29-2010 11:58 AM |
| Old news: Sony PRS-505 wins international red dot design award - 2008 | Wetdogeared | News | 0 | 06-20-2009 10:51 AM |
| Microsoft's latest stunt: On 10 dot net | Alexander Turcic | Lounge | 0 | 03-13-2006 09:06 AM |