Find and Replace with Wildcards

L

Luke Muehlhauser

I read and tried everything suggested and linked-to by the ever-gravious
Graham Mayor and Greg Maxey. At the bottom of the document I have included
a larger excerpt from the full document.

----
(; )(<*)[,] (The) \(
Replace with
\1\3 \2\4 (
----

This, obviously, does not work because only a small portion of the document
actually uses parenthetical year clarifications (only the first two
'sections' concern multiple years). Sorry I did not include a more
representative excerpt of the full document earlier.

----
;([!;,]{1,}),( The)
Replace:
;\2\1
----

The problem here is that because every movie title is 'closed' with a
semicolon, but not always 'opened,' it jumps across lines to grab:

;
<b>Meh: </b>Boxing Cats, The (1894)

when it should only grab:

Boxing Cats, The (1984);

Naturally, I have no problem running multiple find and replace actions
through the document to work on this, so more specific is better than more
general.

Is there a way to designate line breaks in find and replace to avoid some
of the problems with the above examples?

Or, because every movie title is closed with a semicolon, but not every
movie title is immediately preceded by a semicolon, perhaps it would be
better to try to find movie titles by looking for a closing semicolon and
an opening (; OR >)?

Perhaps seperate routines could be written to first fix the ones that fall
between two semicolons (but not across line breaks), then those between a >
and a semicolon?

Thank you, Greg Mayor, for the link to the article on your site. I'm still
churning it through my mind, trying to get it right.


--------------------------EXCERPT--------------------------

Rankings and recommendations consider only the merits of the film, not
historical importance, rarely technical innovation, and are much more based
on 'best films in my opinion' than 'films I most enjoyed watching.' Movies
in 'Also Recommended,' 'Meh,' and 'Garbage' are in no particular order. It
may be useful to <a
href="http://www.listology.com/content_show.cfm/content_id.12794/b_show_new.1">highlight
recent changes</a>.
<br>
<h2>1890-1909 (all shorts)</h2>
<i>55 films seen: 0 feature-length, 55 short</i><ol>
<li>Great Train Robbery, The (1903)
<li>Trip to the Moon, A (1902)
<li>Impossible Voyage, The (1904)
<li>Policemen's Little Run, The (1906)
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)</ol>
<b>Also Recommended: </b>Annabelle Butterfly Dance (1894); Snowball Fight
(1896); Sprinkler Sprinkled, The (1896); Humorous Phases of Funny Faces
(1906);
<b>Meh: </b>Boxing Cats, The (1894); Leonard-Cushing Fight (1894); Edison
Kinetoscopic Record Of A Sneeze (1894); Sioux Ghost Dance (1894); Annabelle
Butterfly Dance (1894); Glenroy Brothers (Comic Boxing) (1894); Exiting the
Factory; Baby's Dinner (1895); Lion, London Zoological Gardens (1895);
Transformation By Hats (1895); Demolition of a Wall (1896); Poultry-Yard
(1896); Cock Fight (1896); Kiss, The (1896); Babies Quarrel (1896);
Promenade of Ostriches, Paris Botanical Gardens (1896); Card Party (1897);
Sky Scrapers of New York City from North River (1903); Trapeze Disrobing
Act (1901); Cook in Trouble, The (1904); Tchin-Tao: The Chinese Conjurer
(1904); Wonderful Living Fan, The (1904); Black Imp, The (1905); Hilarious
Posters, The (1905); Living Playing Cards, The (1905); San Francisco:
Aftermath of Earthquake (1906); Eclipse, The (1907); Troubles of a
Grasswidower (1908); Moscow Clad in Snow (1908); Dog and His Various
Merits, The (1908); Nero (1909);
<b>Garbage: </b>Arrival of a Train at La Ciotat (1896); Carmaux: Drawing
Out the Coke (1896); Feeding the Doves (1896); Sandow (1896); New York,
Broadway at Union Score (1896); Dragoons Crossing the Saone (1896);
President McKinley at Home (1897); Seminary Girls (1897); Pack Train at
Chilkoot Pass (1898); Untamable Whiskers, The (1904); Enchanted Sedan
Chair, The (1905); Whole Dam Family and the Dam Dog, The (1905); Scheming
Gambler's Paradise, The (1905); Mysterious Retort, The (1906); Good Glue
Sticks (1907); Long Distance Wireless Photography (1908);

<h2>1910-1919</h2>
<i>20 films seen: 4 feature-length, 16 short</i><ol>
<li>Birth of a Nation, The (1915)
<li>Broken Blossoms (1919)
<li>Immigrant, The (1917) [short]
<li>Easy Street (1917) [short]
<li>Rink, The (1916) [short]
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)</ol>
<b>Also Recommended: </b>Winsor McCay, the Famous Cartoonist of the N.Y.
Herald and His Moving Comics (1911) [short]; Cameraman's Revenge, The
(1912) [short]; Pool Sharks (1915) [short]; Tramp, The (1915) [short];
Champion, The (1915) [short]; Ask Father (1919) [short];
<b>Meh: </b>Last Days of Pompeii, The (1913); Intolerance (1916); For His
Son (1912) [short]; Aeroplane Flight and Wreck (Piloted by M. Cody) (1910)
[short]; Girl and Her Trust, The (1912) [short]; Bangville Police (1913)
[short]; By the Sea (1915) [short]; Butcher Boy, The (1917) [short];
Adventurer, The (1917) [short];
<b>Garbage: </b>

<h2>2002</h2>
<i>83 films seen: 77 feature-length, 6 short</i><ol>
<li>Adaptation
<li>Frailty
<li>Lord of the Rings: The Two Towers, The
<li>About a Boy
<li>Insomnia
<li>Panic Room
<li>Bowling for Columbine
<li>Gangs of New York
<li>(none yet)
<li>(none yet)</ol>
<b>Also Recommended: </b>About Schmidt; Bend It Like Beckham; Bourne
Identity, The; Catch Me If You Can; Changing Lanes; Confessions of a
Dangerous Mind; Dogtown and Z-Boys; Equilibrium; Igby Goes Down; One Hour
Photo; Irreversible; Lost In La Mancha; Minority Report; Pianist, The;
Punch-Drunk Love; Ring, The; Road to Perdition; Secretary; Signs; Spirited
Away; Talk to Her; Transporter, The Y Tu Mama Tambien; Importance of Being
Earnest, The; Hire: Beat the Devil, The [short]; Hire: Hostage, The
[short]; Hire: Ticker, The [short];
<b>Meh: </b>25th Hour; 8 Mile; Austin Powers in Goldmember; Blood Work;
Count of Monte Cristo, The; Death to Smoochy; Die Another Day; Dragonfly;
Four Feathers, The; Hart's War; Hours, The; Ice Age; Jackass: The Movie;
John Q.; K-19: The Widowmaker; Lilo & Stich; Men in Black II; Mothman
Prophecies, The; My Big Fat Greek Wedding; Narc; Orange County; Red Dragon;
Russian Ark; Simone; Solaris; Spider-Man; Sum of All Fears, The; Super
Troopers; Treasure Planet; Two Weeks Notice; Unfaithful; Walk to Remember,
A; We Were Soldiers; Chubbchubbs!, The [short]; Frankenthumb [short]; Blair
Thumb, The [short];
<b>Garbage: </b>Blade II; Collateral Damage; Comedian; Jonah: A VeggieTales
Movie; Master of Disguise, The; Swimfan; Reign of Fire; Star Wars: Episode
II - Attack of the Clones; Sweet Home Alabama; Time Machine, The; XXX;
Winter Break;

<h2>2003</h2>
<i>65 films seen: 62 feature-length, 3 short</i><ol>
<li>Lord of the Rings: The Return of the King, The
<li>Lost in Translation
<li>Finding Nemo
<li>American Splendor
<li>Monster
<li>In America
<li>Mystic River
<li>Pirates of the Caribbean: The Curse of the Black Pearl
<li>City of God
<li>Dogville</ol>
<b>Also Recommended: </b>Swimming Pool; 21 Grams; 28 Days Later; Bad Santa;
Big Fish; Bruce Almighty; Bubba Ho-Tep; Capturing the Freidmans;
Spellbound; Cold Mountain; Dirty Pretty Things; Identity; Italian Job; Kill
Bill Vol. 1; Last Samurai, The; Master and Commander: The Far Side of the
World; Matchstick Men; Matrix Reloaded, The; Old School; Open Range; Osama;
School of Rock; Seabiscuit; Secondhand Lions; Shattered Glass; Something's
Gotta Give; Terminator 3: Rise of the Machines; Texas Chainsaw Massacre;
Whale Rider; X2: X-Men United; Snow Walker, The; Batman: Dead End [short];
<b>Meh: </b>Freaky Friday; Lewis & Clark: Great Journey West [short];
Batman: Mystery of the Batwoman; City of No Limits, The; Dreamers, The;
DysFunktional Family; Elf; House of Sand and Fog; Intolerable Cruelty;
Matrix Revolutions; Phone Booth; Ripley's Game; Runaway Jury; Shanghai
Knights; Tears of the Sun; Boundin' [short];
<b>Garbage: </b>Bringing Down the House; Gothika; Hunted, The; Hulk; Scary
Movie 3; Peter Pan;
 
G

Graham Mayor

Gravious?

"Greg Mayor"?

Although you have melded us into one Greg and I are separate people
separated by thousands of miles of ocean ;)

I have looked again at this larger example and I still see no way to tie
down the disparate entries in order to make this search possible. There is
no consistency in the format that would lend itself to replace. Furthermore
the text format of the newsgroup in which your example is displayed
conspires against reproducing your exact document. I cannot guarantee that
when I paste it into Word, it will have the line breaks in the correct
places.

I even imported it into FrontPage to see if that would help - it didn't :(

It may be possible to create a macro that would do this, but frankly I see
that running into the same problems.

FWIW having viewed it in FrontPage, I prefer it as it is ;)
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>




Luke said:
I read and tried everything suggested and linked-to by the
ever-gravious
Graham Mayor and Greg Maxey. At the bottom of the document I have
included
a larger excerpt from the full document.

----
(; )(<*)[,] (The) \(
Replace with
\1\3 \2\4 (
----

This, obviously, does not work because only a small portion of the
document
actually uses parenthetical year clarifications (only the first two
'sections' concern multiple years). Sorry I did not include a more
representative excerpt of the full document earlier.

----
;([!;,]{1,}),( The)
Replace:
;\2\1
----

The problem here is that because every movie title is 'closed' with a
semicolon, but not always 'opened,' it jumps across lines to grab:

;
<b>Meh: </b>Boxing Cats, The (1894)

when it should only grab:

Boxing Cats, The (1984);

Naturally, I have no problem running multiple find and replace actions
through the document to work on this, so more specific is better than
more
general.

Is there a way to designate line breaks in find and replace to avoid
some
of the problems with the above examples?

Or, because every movie title is closed with a semicolon, but not
every
movie title is immediately preceded by a semicolon, perhaps it would
be
better to try to find movie titles by looking for a closing semicolon
and
an opening (; OR >)?

Perhaps seperate routines could be written to first fix the ones that
fall
between two semicolons (but not across line breaks), then those
between a >
and a semicolon?

Thank you, Greg Mayor, for the link to the article on your site. I'm
still
churning it through my mind, trying to get it right.


--------------------------EXCERPT--------------------------

Rankings and recommendations consider only the merits of the film, not
historical importance, rarely technical innovation, and are much more
based
on 'best films in my opinion' than 'films I most enjoyed watching.'
Movies
in 'Also Recommended,' 'Meh,' and 'Garbage' are in no particular
order. It
may be useful to <a
href="http://www.listology.com/content_show.cfm/content_id.12794/b_show_new.1">highlight
recent changes</a>.
<br>
<h2>1890-1909 (all shorts)</h2>
<i>55 films seen: 0 feature-length, 55 short</i><ol>
<li>Great Train Robbery, The (1903)
<li>Trip to the Moon, A (1902)
<li>Impossible Voyage, The (1904)
<li>Policemen's Little Run, The (1906)
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)</ol>
<b>Also Recommended: </b>Annabelle Butterfly Dance (1894); Snowball
Fight (1896); Sprinkler Sprinkled, The (1896); Humorous Phases of
Funny Faces (1906);
<b>Meh: </b>Boxing Cats, The (1894); Leonard-Cushing Fight (1894);
Edison
Kinetoscopic Record Of A Sneeze (1894); Sioux Ghost Dance (1894);
Annabelle
Butterfly Dance (1894); Glenroy Brothers (Comic Boxing) (1894);
Exiting the
Factory; Baby's Dinner (1895); Lion, London Zoological Gardens (1895);
Transformation By Hats (1895); Demolition of a Wall (1896);
Poultry-Yard (1896); Cock Fight (1896); Kiss, The (1896); Babies
Quarrel (1896);
Promenade of Ostriches, Paris Botanical Gardens (1896); Card Party
(1897);
Sky Scrapers of New York City from North River (1903); Trapeze
Disrobing
Act (1901); Cook in Trouble, The (1904); Tchin-Tao: The Chinese
Conjurer (1904); Wonderful Living Fan, The (1904); Black Imp, The
(1905); Hilarious
Posters, The (1905); Living Playing Cards, The (1905); San Francisco:
Aftermath of Earthquake (1906); Eclipse, The (1907); Troubles of a
Grasswidower (1908); Moscow Clad in Snow (1908); Dog and His Various
Merits, The (1908); Nero (1909);
<b>Garbage: </b>Arrival of a Train at La Ciotat (1896); Carmaux:
Drawing
Out the Coke (1896); Feeding the Doves (1896); Sandow (1896); New
York,
Broadway at Union Score (1896); Dragoons Crossing the Saone (1896);
President McKinley at Home (1897); Seminary Girls (1897); Pack Train
at
Chilkoot Pass (1898); Untamable Whiskers, The (1904); Enchanted Sedan
Chair, The (1905); Whole Dam Family and the Dam Dog, The (1905);
Scheming
Gambler's Paradise, The (1905); Mysterious Retort, The (1906); Good
Glue
Sticks (1907); Long Distance Wireless Photography (1908);

<h2>1910-1919</h2>
<i>20 films seen: 4 feature-length, 16 short</i><ol>
<li>Birth of a Nation, The (1915)
<li>Broken Blossoms (1919)
<li>Immigrant, The (1917) [short]
<li>Easy Street (1917) [short]
<li>Rink, The (1916) [short]
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)
<li>(none yet)</ol>
<b>Also Recommended: </b>Winsor McCay, the Famous Cartoonist of the
N.Y.
Herald and His Moving Comics (1911) [short]; Cameraman's Revenge, The
(1912) [short]; Pool Sharks (1915) [short]; Tramp, The (1915) [short];
Champion, The (1915) [short]; Ask Father (1919) [short];
<b>Meh: </b>Last Days of Pompeii, The (1913); Intolerance (1916); For
His
Son (1912) [short]; Aeroplane Flight and Wreck (Piloted by M. Cody)
(1910) [short]; Girl and Her Trust, The (1912) [short]; Bangville
Police (1913) [short]; By the Sea (1915) [short]; Butcher Boy, The
(1917) [short];
Adventurer, The (1917) [short];
<b>Garbage: </b>

<h2>2002</h2>
<i>83 films seen: 77 feature-length, 6 short</i><ol>
<li>Adaptation
<li>Frailty
<li>Lord of the Rings: The Two Towers, The
<li>About a Boy
<li>Insomnia
<li>Panic Room
<li>Bowling for Columbine
<li>Gangs of New York
<li>(none yet)
<li>(none yet)</ol>
<b>Also Recommended: </b>About Schmidt; Bend It Like Beckham; Bourne
Identity, The; Catch Me If You Can; Changing Lanes; Confessions of a
Dangerous Mind; Dogtown and Z-Boys; Equilibrium; Igby Goes Down; One
Hour
Photo; Irreversible; Lost In La Mancha; Minority Report; Pianist, The;
Punch-Drunk Love; Ring, The; Road to Perdition; Secretary; Signs;
Spirited
Away; Talk to Her; Transporter, The Y Tu Mama Tambien; Importance of
Being
Earnest, The; Hire: Beat the Devil, The [short]; Hire: Hostage, The
[short]; Hire: Ticker, The [short];
<b>Meh: </b>25th Hour; 8 Mile; Austin Powers in Goldmember; Blood
Work;
Count of Monte Cristo, The; Death to Smoochy; Die Another Day;
Dragonfly;
Four Feathers, The; Hart's War; Hours, The; Ice Age; Jackass: The
Movie;
John Q.; K-19: The Widowmaker; Lilo & Stich; Men in Black II; Mothman
Prophecies, The; My Big Fat Greek Wedding; Narc; Orange County; Red
Dragon;
Russian Ark; Simone; Solaris; Spider-Man; Sum of All Fears, The; Super
Troopers; Treasure Planet; Two Weeks Notice; Unfaithful; Walk to
Remember,
A; We Were Soldiers; Chubbchubbs!, The [short]; Frankenthumb [short];
Blair
Thumb, The [short];
<b>Garbage: </b>Blade II; Collateral Damage; Comedian; Jonah: A
VeggieTales
Movie; Master of Disguise, The; Swimfan; Reign of Fire; Star Wars:
Episode
II - Attack of the Clones; Sweet Home Alabama; Time Machine, The; XXX;
Winter Break;

<h2>2003</h2>
<i>65 films seen: 62 feature-length, 3 short</i><ol>
<li>Lord of the Rings: The Return of the King, The
<li>Lost in Translation
<li>Finding Nemo
<li>American Splendor
<li>Monster
<li>In America
<li>Mystic River
<li>Pirates of the Caribbean: The Curse of the Black Pearl
<li>City of God
<li>Dogville</ol>
<b>Also Recommended: </b>Swimming Pool; 21 Grams; 28 Days Later; Bad
Santa;
Big Fish; Bruce Almighty; Bubba Ho-Tep; Capturing the Freidmans;
Spellbound; Cold Mountain; Dirty Pretty Things; Identity; Italian
Job; Kill
Bill Vol. 1; Last Samurai, The; Master and Commander: The Far Side of
the
World; Matchstick Men; Matrix Reloaded, The; Old School; Open Range;
Osama;
School of Rock; Seabiscuit; Secondhand Lions; Shattered Glass;
Something's
Gotta Give; Terminator 3: Rise of the Machines; Texas Chainsaw
Massacre;
Whale Rider; X2: X-Men United; Snow Walker, The; Batman: Dead End
[short]; <b>Meh: </b>Freaky Friday; Lewis & Clark: Great Journey West
[short];
Batman: Mystery of the Batwoman; City of No Limits, The; Dreamers,
The;
DysFunktional Family; Elf; House of Sand and Fog; Intolerable Cruelty;
Matrix Revolutions; Phone Booth; Ripley's Game; Runaway Jury; Shanghai
Knights; Tears of the Sun; Boundin' [short];
<b>Garbage: </b>Bringing Down the House; Gothika; Hunted, The; Hulk;
Scary
Movie 3; Peter Pan;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top