Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression
No Match

r"
"
gmi

Test String

Code Generator

Generated Code

# coding=utf8 # the above tag defines encoding for this document and is for Python 2.x compatibility import re regex = r"^(?P<characterLine>(?:\t\t\t[a-zA-Z0-9].*\n)+)" test_str = ("\n\n\n\n\n" " STAR TREK: THE NEXT GENERATION \n" " \n" " \"Time Squared\" \n" " #40272-139 \n" " \n" " Story by \n" " Kurt Michael Bensmiller \n" " \n" " Teleplay by \n" " Maurice Hurley \n" " \n" " Directed by \n" " Joseph L. Scanlan \n\n\n" "THE WRITING CREDITS MAY NOT BE FINAL AND SHOULD NOT BE USED\n" "FOR PUBLICITY OR ADVERTISING PURPOSES WITHOUT FIRST CHECKING\n" "WITH THE TELEVISION LEGAL DEPARTMENT.\n\n" "Copyright 1989 Paramount Pictures Corporation. All Rights\n" "Reserved. This script is not for publication or\n" "reproduction. No one is authorized to dispose of same. If\n" "lost or destroyed, please notify the Script Department.\n\n\n" " REVISED FINAL DRAFT\n\n" " JANUARY 25, 1989\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - CAST \n\n" " STAR TREK: THE NEXT GENERATION \n" " \"Time Squared\" \n\n" " CAST \n" " \n" " PICARD/P2 \n" " RIKER \n" " DATA \n" " PULASKI \n" " TROI \n" " GEORDI \n" " WORF \n" " O'BRIEN \n\n" " Non-Speaking \n" " CREWMEMBERS\n\n" " Voice-Over \n" " COMPUTER VOICE\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - SETS \n\n" " STAR TREK: THE NEXT GENERATION \n" " \"Time Squared\" \n" " \n" " SETS \n\n" " INTERIORS EXTERIORS\n" " \n" " USS ENTERPRISE USS ENTERPRISE\n" " RIKER'S QUARTERS\n" " MAIN BRIDGE SHUTTLECRAFT\n" " GEORDI'S ENGINEERING\n" " STATION\n" " SHUTTLE BAY TWO\n" " CORRIDOR\n" " OUTSIDE SICKBAY\n" " SICKBAY\n" " OBSERVATION LOUNGE\n" " TURBOLIFT\n" " CAPTAIN'S READY ROOM\n" " MAIN ENGINEERING\n" " \n" " SHUTTLECRAFT\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - TEASER 1.\n\n" " STAR TREK: THE NEXT GENERATION \n" " \"Time Squared\" \n" " \n" " TEASER \n\n" " FADE IN:\n\n" "1 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " moves along at warp speed.\n\n" "2 INT. RIKER'S QUARTERS (OPTICAL)\n\n" " RIKER has cleared a space on his desk and set up a\n" " little work station. He has a bowl and several\n" " strange-looking eggs. Some smaller containers with\n" " other ingredients and condiments for what appears to\n" " be an omelet. He breaks the last egg into the bowl\n" " and whips them with a jerry-rigged whisk. He is\n" " obviously enjoying himself. The CHIME SOUNDS.\n\n" " RIKER\n" " Come in.\n\n" " The door opens; it's DATA and GEORDI carrying what look\n" " like a homemade Bunsen burner and a frying pan.\n\n" " RIKER\n" " (continuing)\n" " Excellent. Exactly what I need.\n\n" " Before the door closes, PULASKI appears, carrying\n" " something.\n\n" " RIKER\n" " (continuing)\n" " Well, Doctor, and bearing gifts?\n\n" " PULASKI\n" " Ale from Ennan Six... your omelets\n" " deserve no less.\n\n" " Again before the door can close, WORF appears and\n" " follows them into the room.\n\n" "3 THE TABLE\n\n" " Riker sets up the \"Bunsen-type burner,\" ignites it,\n" " heats the pan and pours in the beaten eggs, while Data\n" " watches.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - TEASER 2.\n\n" "3 CONTINUED:\n\n" " DATA\n" " This is not an efficient method\n" " for the preparation of sustenance.\n\n" " RIKER\n" " You're right, Data. The ship's\n" " computer is much more efficient,\n" " but it lacks the subtlety needed\n" " for great cooking. It mixes the\n" " ingredients to precise\n" " measurements. There's no flair,\n" " no individuality, and Data, as\n" " we both know... inspiration and\n" " flair are the difference between\n" " artistry and mere competence.\n\n" " PULASKI\n" " For much of the history of\n" " mankind, the breaking of bread\n" " was a sign of friendship and\n" " community. Something we have\n" " gotten away from in the\n" " twenty-fourth century.\n" " (re: Riker and the\n" " whisk)\n" " You have a practiced hand,\n" " Commander.\n\n" " RIKER\n" " I have my father to thank for\n" " that.\n\n" " PULASKI\n" " Oh, your father liked to cook?\n\n" " RIKER\n" " No, he hated it. It was a chore\n" " left to me.\n\n" " WORF\n" " It is my understanding that in\n" " most human families, the woman\n" " shares in the cooking.\n\n" " RIKER\n" " There were only the two of us.\n" " I never knew my mother. She died\n" " when I was very young.\n\n" "4 PULASKI\n\n" " as she pours the ale -\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - TEASER 3.\n\n" "5 DATA\n\n" " as he takes a sip.\n\n" " GEORDI\n" " Where did you get the eggs?\n\n" " RIKER\n" " During our last stop.\n\n" " GEORDI\n" " (with surprise)\n" " At Starbase seventy-three?\n\n" " RIKER\n" " Yes.\n\n" "6 SCENE\n\n" " as Riker dishes up the food. And they all sit down\n" " to eat, all eager to enjoy the meal. Geordi is the\n" " first to taste it; it clearly does not suit his palate.\n\n" " GEORDI\n" " What kind of eggs did you say\n" " these are?\n\n" " As Riker takes a bite:\n\n" " RIKER\n" " 'Owon.\n\n" " From Geordi's expression it's apparent the eggs are\n" " lacking. Riker and Pulaski both react to the uneatable\n" " food.\n\n" " RIKER\n" " (continuing)\n" " A cook's only as good as his\n" " ingredients.\n\n" " Then they look over at Worf, who is enjoying it\n" " immensely.\n\n" " WORF\n" " Delicious.\n\n" " Something to end the scene.\n\n" " PICARD'S COM VOICE\n" " Commander Riker...\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - TEASER 4.\n\n" "6 CONTINUED:\n\n" " RIKER\n" " Yes, Captain.\n\n" " PICARD'S COM VOICE\n" " Would you join me on the bridge?\n\n" " RIKER\n" " On my way.\n\n" " Without having to be told, Data and Worf leave with\n" " him. Worf pausing to take one last forkful of omelet.\n\n" "7 INT. MAIN BRIDGE\n\n" " Riker, Data and Worf ENTER and take their positions.\n\n" " PICARD\n" " We have picked up an automated\n" " signal from a Federation\n" " shuttlecraft.\n\n" " Riker looks surprised and confused.\n\n" " RIKER\n" " A shuttle? Out here?! How is\n" " that possible? We're the first\n" " manned Federation vessel to enter\n" " this area.\n\n" " PICARD\n" " Apparently not.\n\n" " RIKER\n" " So what's a shuttle doing out this\n" " far? And where's the mother ship?\n\n" " PICARD\n" " I don't know.\n\n" " WORF\n" " Sensors indicate there is at least\n" " one life-form on board the\n" " shuttle. Humanoid.\n\n" " PICARD\n" " Perhaps someone to answer your\n" " questions, Number One. Open\n" " hailing frequencies.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - TEASER 5.\n\n" "7 CONTINUED:\n\n" " WORF\n" " Captain, the shuttle is without\n" " power. Communication is not\n" " possible.\n\n" " RIKER\n" " Set course to intercept.\n\n" " DATA\n" " Estimate intercept in three\n" " minutes.\n\n" "8 OMITTED\n\n" "9 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " veers off course to intercept with the shuttlecraft.\n\n" " FADE OUT.\n\n" " END OF TEASER \n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 6.\n\n" " ACT ONE \n\n" " FADE IN:\n\n" "10 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " comes out of warp.\n\n" " PICARD (V.O.)\n" " Captain's log, stardate 42679.2.\n" " While traversing an unexplored\n" " section of the galaxy en route\n" " to the Endicor system, a\n" " Federation shuttlecraft has quite\n" " suddenly appeared -- virtually out\n" " of nowhere. There are no other\n" " ships in the vicinity -- and no\n" " indications whence it came nor\n" " how it got out here.\n\n" "11 INT. MAIN BRIDGE\n\n" " The bridge is as before.\n\n" " WORF\n" " We are closing on shuttlecraft.\n\n" " PICARD\n" " On screen.\n\n" "12 ANGLE TO INCLUDE VIEWSCREEN (OPTICAL)\n\n" " as the image changes and the shuttle appears -- it is\n" " out of control -- cartwheeling through space.\n\n" " RIKER\n" " Magnify.\n\n" " The image changes again. The shuttle now appears in\n" " close-up.\n\n" " RIKER\n" " (continuing)\n" " Prepare to lock tractor beam.\n\n" "13 OMITTED\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 7.\n\n" "14 INT. MAIN BRIDGE\n\n" " as before.\n\n" " DATA\n" " Target vehicle -- we will be within\n" " tractor beam range in two zero\n" " seconds.\n\n" " RIKER\n" " Set automatic locking device.\n" " Alert Shuttle Bay Two.\n\n" "15 INT. SHUTTLE BAY TWO (OPTICAL)\n\n" " as the Enterprise closes with the violently spinning\n" " shuttlecraft.\n\n" "16 INT. MAIN BRIDGE\n\n" " as before...\n\n" " DATA\n" " Locking tractor beam.\n\n" "17 INT. SHUTTLE BAY TWO (OPTICAL)\n\n" " as the tractor beam shoots out from the Enterprise and\n" " grabs the shuttlecraft and stabilizes it.\n\n" "18 INT. MAIN BRIDGE\n\n" " as before...\n\n" " DATA\n" " The tractor beam has been locked.\n\n" " PICARD\n" " Number One.\n\n" " Riker is out of his chair and heading for the\n" " turbolift.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 8.\n\n" "18 CONTINUED:\n\n" " RIKER\n" " Worf -- you're with me.\n\n" " PICARD\n" " Doctor Pulaski, you are needed\n" " in Shuttle Bay Two.\n\n" " PULASKI'S COM VOICE\n" " I have been monitoring. I am\n" " on my way.\n\n" "19 INT. SHUTTLE BAY TWO (OPTICAL)\n\n" " The doors have been opened. The shuttle, held firmly\n" " by the tractor beam, is being pulled toward the\n" " Enterprise, as Riker and Worf ENTER.\n\n" "20 ANOTHER ANGLE (OPTICAL)\n\n" " as the shuttle moves closer. An n.d. crewmember, at a\n" " control panel near the door, attaches a second tractor\n" " beam, which automatically releases the first -- stronger\n" " one -- and transfers control to the n.d. operator.\n\n" "21 RIKER AND WORF\n\n" " They move closer as the shuttlecraft is pulled on\n" " board.\n\n" "22 SHUTTLECRAFT (OPTICAL)\n\n" " as it settles on the floor.\n\n" " The doors are closing as the tractor beam disengages.\n\n" "23 SCENE\n\n" " As Riker and Worf move closer, Doctor Pulaski ENTERS\n" " the Shuttle Bay with an assistant.\n\n" " RIKER\n" " Well, it's a Federation shuttle\n" " all right.\n\n" " WORF\n" " Yet, there are no Federation\n" " vessels or bases in this area.\n\n" " Riker steps closer.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 9.\n\n" "24 RIKER AND SHUTTLE\n\n" " He reads the registration number. On the other side\n" " of the craft, Pulaski and two n.d. crewmembers are\n" " working to open the shuttle door.\n\n" " RIKER\n" " (reading)\n" " NCC one-seven-zero-one-D -- USS\n" " Enterprise, shuttle number\n" " five.\n\n" " He turns in shock and stares at Worf. Riker looks back\n" " at the registration number to be sure he read it\n" " correctly. Riker then looks to the other side of the\n" " Shuttle Bay...\n\n" "25 SCENE (OPTICAL)\n\n" " ... to another shuttlecraft, identical in design to the\n" " one which was just brought on board, and carrying the\n" " exact same number.\n\n" " RIKER\n" " (reading)\n" " NCC one-seven-zero-one-D -- USS\n" " Enterprise shuttle number\n" " five.\n\n" " WORF\n" " How is this possible?\n\n" "26 OTHER SIDE OF SHUTTLE\n\n" " The crewmembers get the door open. Pulaski starts to\n" " enter, then freezes. Pulaski calls out:\n\n" " PULASKI\n" " Commander! Come here!\n\n" "27 RIKER AND WORF\n\n" " The urgency in her voice sends Riker and Worf quickly\n" " around to the other side of the shuttle where:\n\n" "28 ANOTHER ANGLE\n\n" " Pulaski steps back to allow Riker to look in.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 10.\n\n" "29 RIKER\n\n" " Instantly he understands the reason for Pulaski's\n" " reaction.\n\n" "30 SHUTTLECRAFT\n\n" " Slumped over the controls is CAPTAIN JEAN-LUC PICARD.\n" " Unconscious, but otherwise exactly the same as the man\n" " we just left on the bridge!\n\n" " RIKER\n" " (he touches his\n" " communicator)\n" " Captain?\n\n" " PICARD'S COM VOICE\n" " What is it, Number One?\n\n" " RIKER\n" " Captain, are you on the bridge?\n\n" " PICARD'S COM VOICE\n" " (irritated)\n" " Where else would I be?\n\n" " RIKER\n" " Right now, I think you had better\n" " be in Shuttle Bay Two.\n\n" " PICARD'S COM VOICE\n" " Why? What is it?\n\n" " RIKER\n" " This you had better see for\n" " yourself and, Captain, bring\n" " Commander Data.\n\n" "31 ANOTHER ANGLE - SHUTTLE BAY TWO\n\n" " Picard and Data ENTER. Pulaski is in the shuttle\n" " checking P2's condition. The tension level in the\n" " room is very high. Without being called, TROI\n" " instinctively ENTERS the Shuttle Bay.\n\n" "32 PICARD\n\n" " as he moves closer he sees what has them all so\n" " concerned.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 11.\n\n" "33 INTERCUT\n\n" " the others, all waiting to see how Picard is going to\n" " react.\n\n" "34 PICARD\n\n" " moves closer, wanting to be certain his eyes are\n" " telling him the truth. Riker moves up next to him.\n" " For a beat they both watch Pulaski as she does her\n" " medical checks.\n\n" "35 SCENE\n\n" " Data is nearby, waiting to enter the shuttle as soon as\n" " Pulaski is clear.\n\n" " RIKER\n" " We have been in a lot of bizarre\n" " situations, but nothing like this.\n\n" " Picard's response comes out as a grunt. Seeing a\n" " duplicate of himself, in a duplicate of an Enterprise\n" " shuttlecraft, has put Picard and the others under\n" " enormous strain, so much so that words come slowly. No\n" " one knows what to say, and all are waiting for some\n" " explanation about what's going on. This all plays off\n" " Picard, who is the most involved. In a strange way the\n" " crew avoids making eye contract with Picard.\n\n" " PICARD\n" " What's his condition?\n\n" "36 SHUTTLE (OPTICAL)\n\n" " Pulaski completes her scan.\n\n" " PULASKI\n" " The life signs are confusing.\n" " I get a strong heartbeat, but the\n" " rhythm is off.\n\n" " PICARD\n" " Has he been injured?\n\n" " PULASKI\n" " No signs of trauma.\n\n" " PICARD\n" " Then why is he unconscious? What\n" " happened to him?\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 12.\n\n" "36 CONTINUED:\n\n" " PULASKI\n" " I can't say.\n\n" " As she scans P2's head she gently touches his face, as\n" " if double checking her readings.\n\n" " PULASKI\n" " (continuing)\n" " The readings from his brain waves\n" " are very... strange.\n\n" " Little alarm bells go off for Picard.\n\n" " PICARD\n" " Strange? In what way? Non-human?\n" " Artificial?\n\n" " PULASKI\n" " No -- neither. They are just out\n" " of phase.\n\n" " PICARD\n" " Can you revive him?\n\n" " PULASKI\n" " I won't attempt it until he's in\n" " Sickbay.\n" " (she holds the look for\n" " a beat, then:)\n" " Let's get him there.\n\n" " Pulaski and her medical team remove P2.\n\n" "37 PICARD AND TROI (OPTICAL)\n\n" " Both are confounded.\n\n" " PICARD\n" " Counselor.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 13.\n\n" "37 CONTINUED:\n\n" " TROI\n" " I have never felt anything quite\n" " like this so it is difficult to\n" " put into words.\n" " (she pauses to gather\n" " her thoughts)\n" " That person is you. What I mean,\n" " the person we are looking at is\n" " as much Jean-Luc Picard as the\n" " person I am standing next to;\n" " beyond that there's very little\n" " of which I am sure. I will have\n" " to wait until he is conscious\n" " before knowing more.\n\n" "38 SCENE\n\n" " PICARD\n" " Data, we have to know what is on\n" " the shuttle's logs.\n\n" " DATA\n" " Yes, sir.\n\n" " Data enters the damaged shuttle.\n\n" "39 INT./EXT. SHUTTLE\n\n" " Data takes the command position and attempts to\n" " activate the system.\n\n" " DATA\n" " Both primary and reserve power\n" " has been drained from the shuttle.\n" " I am going to have to connect\n" " to the Enterprise in order to\n" " activate the shuttle's systems.\n\n" " RIKER\n" " Lieutenant La Forge -- report to\n" " Shuttle Bay Two.\n\n" " GEORDI'S COM VOICE\n" " I'm on my way.\n\n" " PICARD\n" " Number One, I'll be in Sickbay.\n" " Keep me informed.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 14.\n\n" "39 CONTINUED:\n\n" " RIKER\n" " (indicating an unusual\n" " burn on the skin of\n" " the shuttle)\n" " Did you see this, Captain?\n\n" " Picard steps over to the shuttle and examines the burn.\n\n" " PICARD\n" " It looks like the kind of damage\n" " caused by an antimatter explosion.\n\n" " RIKER\n" " Yes, the shuttle must have been\n" " just out of range.\n\n" " PICARD\n" " (urgent)\n" " Data, I need those logs.\n" " (to Troi)\n" " Counselor.\n\n" " As Picard and Troi EXIT:\n\n" " RIKER\n" " We'll be on the bridge.\n\n" " He and Worf EXIT as Geordi ARRIVES.\n\n" "39A INT. MAIN BRIDGE\n\n" " Riker and Worf ENTER and go to their stations.\n\n" " RIKER\n" " Resume course and speed.\n" " (to Worf)\n" " Scanners at maximum range.\n\n" " WORF\n" " Maximum range.\n\n" "39B EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " as the Enterprise stretches to warp speed.\n\n" "40 INT. SHUTTLE BAY TWO (OPTICAL)\n\n" " Geordi comes around to the shuttle door. Data is\n" " sitting at the controls.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 15.\n\n" "40 CONTINUED:\n\n" " GEORDI\n" " You should have power now.\n\n" " Data activates the shuttle's on-board computer.\n\n" " There is a SUDDEN EXPLOSION. Filling the shuttle with\n" " sparks.\n\n" "41 DATA (OPTICAL)\n\n" " neither affected nor distracted by the chaos around\n" " him, calmly shuts down the unit.\n\n" " GEORDI\n" " What happened?\n\n" " DATA\n" " The polarity was not\n" " compatible.\n\n" " GEORDI\n" " Not possible, the connection is\n" " idiot proof.\n\n" " DATA\n" " The power requirements of the\n" " shuttle do not match the\n" " Enterprise. We are going to need\n" " a variable phase inverter, to\n" " align the power from the\n" " Enterprise to the circuits of the\n" " shuttle.\n\n" " GEORDI\n" " Data, what do you think is going\n" " on? I don't just mean about the\n" " shuttle, I mean about all of this?\n\n" " DATA\n" " I do not have enough information.\n\n" " GEORDI\n" " The captain here, the captain\n" " there. This shuttle -- that\n" " shuttle. Commander Riker is right -- this\n" " is very strange.\n\n" "42\n" "thru OMITTED\n" "43\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 16.\n\n" "44 INT. CORRIDOR - OUTSIDE SICKBAY\n\n" " Picard and Troi are approaching Sickbay.\n\n" " PICARD\n" " This smells like a set-up.\n\n" " TROI\n" " A trap?\n\n" " PICARD\n" " (nods, yes)\n" " If it is me, me from where? And\n" " why in a shuttle? There is\n" " nothing about this which is random\n" " or happenstance. Look beneath\n" " the boards, Counselor; I expect\n" " something foul and familiar to\n" " crawl out.\n\n" " Picard holds her look for a beat, then turns and ENTERS\n" " Sickbay.\n\n" "45 INT. SICKBAY (OPTICAL)\n\n" " They have placed P2 in the center of Sickbay. Pulaski\n" " is doing her medical work-ups.\n\n" " PULASKI\n" " We have just started doing a\n" " complete work-up. The vital signs\n" " are distorted. Some of the\n" " indicators are totally depressed,\n" " others are fluctuating wildly.\n" " I can't explain any of it. But\n" " he is alive, and I don't think\n" " he's in any immediate danger.\n\n" " She activates a forcefield, which briefly appears as\n" " a restraining device.\n\n" " PULASKI\n" " (continuing)\n" " The restraints are for his own\n" " protection.\n\n" " PICARD\n" " Have you been able to determine\n" " why he is still unconscious?\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 16A.\n\n" "45 CONTINUED:\n\n" " PULASKI\n" " I have been able to rule out head\n" " injury -- otherwise there is no\n" " apparent cause.\n\n" " PICARD\n" " Wake him.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 17.\n\n" "45 CONTINUED: (2)\n\n" " She touches the hypospray to his neck. Suddenly all of\n" " the indicators fall to zero. Pulaski quickly adjusts\n" " her hypospray and gives P2 another injection. While\n" " they watch, the indicators return to their previous\n" " readings.\n\n" " PICARD\n" " (continuing)\n" " What happened?\n\n" " PULASKI\n" " Apparently a normal stimulant had\n" " the opposite effect. I'll have\n" " to try something else.\n\n" " She steps over to a counter to prepare a different\n" " injection. Picard moves slightly closer to himself.\n\n" "46 INT. SHUTTLE BAY TWO\n\n" " Geordi and Data are working together to synchronize the\n" " power from the Enterprise with the circuits of the\n" " shuttlecraft.\n\n" " GEORDI\n" " There... that should give you\n" " something. Making this power\n" " adjustment is very tricky. By\n" " all rights, this connection should\n" " overload all the shuttle's\n" " circuits.\n\n" " Data steps over to the shuttle control position.\n\n" " DATA\n" " Perhaps you had better step back\n" " out of the way.\n\n" " Geordi responds.\n\n" " GEORDI\n" " Remember you're not indestructible\n" " yourself.\n\n" " Data again attempts to activate the systems.\n\n" "47 SHUTTLE\n\n" " The lights on the control panel come on, then die out.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 17A.\n\n" "47 CONTINUED:\n\n" " DATA\n" " Increase the power.\n\n" " The lights come back.\n\n" " DATA\n" " (continuing)\n" " Adjust the invert two percent\n" " positive.\n\n" " The lights dim.\n\n" " GEORDI\n" " That's the correct decision, but\n" " it's having the opposite effect.\n\n" " DATA\n" " Yes.\n\n" " GEORDI\n" " There is nothing I can think of\n" " which could cause such a radical\n" " change in this circuit.\n\n" " DATA\n" " Adjust the invert two percent\n" " negative.\n\n" " The lights glow brighter and hold.\n\n" " GEORDI\n" " Got it. It shouldn't work, but\n" " it does.\n\n" " The lights glow brighter and hold. Geordi steps in\n" " beside Data.\n\n" " GEORDI\n" " (continuing;\n" " stunned)\n" " Data, take a look at the stardate.\n\n" " Data looks at the control panel.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT ONE 18.\n\n" "47 CONTINUED: (2)\n\n" " GEORDI\n" " (continuing)\n" " Four-two-six-seven-nine-point-five.\n" " (he touches his\n" " communicator)\n" " Captain.\n\n" "48 INT. SICKBAY\n\n" " They are still gathered around P2.\n\n" " PICARD\n" " Go ahead.\n\n" " GEORDI'S COM VOICE\n" " Captain, we have been able to\n" " activate the shuttle; the on-board\n" " clock indicates that the shuttle\n" " is six hours ahead of us.\n\n" " Picard moves a step closer to P2... up until this time\n" " he has carefully kept his distance.\n\n" " GEORDI'S COM VOICE\n" " (continuing)\n" " Captain, did you read me? If the\n" " shuttle is from six hours into\n" " the future, so is the other\n" " Captain Picard.\n\n" "49 PICARD\n\n" " He studies P2. Off his reaction:\n\n" " FADE OUT.\n\n" " END OF ACT ONE \n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 19.\n\n" " ACT TWO \n\n" " FADE IN:\n\n" "50 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " at warp speed.\n\n" " PICARD (V.O.)\n" " Captain's log, supplemental. Part\n" " of the mystery has been solved.\n" " The reason there are two NCC\n" " one-seven-zero-one-D-five\n" " shuttlecrafts is because one of\n" " them is from the future... six\n" " hours to be exact. And, so\n" " presumably is the facsimile of\n" " me.\n\n" "51 INT. SICKBAY\n\n" " Picard is there with Pulaski and Troi.\n\n" " PICARD\n" " Try to wake him, again.\n\n" " Pulaski gives Picard a little look, then adjusts her\n" " hypospray and touches it to P2's neck.\n\n" "52 P2\n\n" " ... he becomes conscious. His face is a mask of\n" " terror, pain and fear. His head rolls back and he\n" " tries to scream, but no sound comes. As he looks\n" " around, his movements have a strange stuttering\n" " quality.\n\n" "53 PICARD\n\n" " He reacts to seeing himself as he has never felt, nor\n" " ever thought he would feel, out of control and\n" " impotent.\n\n" "54 PULASKI\n\n" " She moves to comfort P2, but his flaying hands hold her\n" " off. His movements come in a series of stutters. He's\n" " here - in this Sickbay, on this ship, but if as though\n" " he were in another dimension as well.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 20.\n\n" "55 PICARD\n\n" " Troi is close beside him. They watch as:\n\n" "56 P2\n\n" " He pushes in his herky-jerky way against an unseen wall\n" " behind which he is imprisoned. His mouth is open --\n" " but still there is no sound.\n\n" "57 PICARD\n\n" " The terror of seeing himself in such a condition. A\n" " little sound comes from him... It's primal, in response\n" " to what he sees and the anguish he feels from his\n" " otherself's helpless condition.\n\n" "58 SCENE\n\n" " Pulaski responds to seeing a patient in this condition,\n" " steps up to touch the hypospray to P2's neck.\n\n" " PICARD\n" " No!\n\n" " The word explodes from him.\n\n" " PULASKI\n" " It's a only a sedative.\n\n" " PICARD\n" " I know what it is... don't sedate\n" " him. Let him be!\n" " (then, changing his\n" " tone)\n" " Please... allow him to remain\n" " conscious.\n\n" "59 P2\n\n" " If P2 is aware of his surroundings, it would be\n" " impossible to tell. But clearly he is in some kind of\n" " horror chamber, from which he cannot escape.\n\n" " PULASKI\n" " I have never seen anything like\n" " this.\n\n" " Pulaski looks over at Picard. The color has been\n" " drained from his face.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 21.\n\n" "59 CONTINUED:\n\n" " PULASKI\n" " (continuing)\n" " Captain, you had better sit down.\n\n" " Picard waves her off.\n\n" " PICARD\n" " I'm fine, Doctor... Save your\n" " ministrations for the patient.\n" " I want a staff meeting in five\n" " minutes. Doctor, I assume you\n" " will want to remain here.\n\n" " She acknowledges with a nod. Picard turns and heads\n" " for the exit.\n\n" " PULASKI\n" " I will monitor the conference\n" " from here.\n\n" " PICARD\n" " Keep me informed, Doctor -- of any\n" " change no matter how small.\n\n" "60 INT. OBSERVATION LOUNGE (OPTICAL)\n\n" " Riker is there with Picard, Data, Geordi, Worf and\n" " Troi. Pulaski is still in Sickbay with P2.\n\n" " GEORDI\n" " Captain, we have retrieved all\n" " we are going to get from the\n" " shuttle logs, including the last\n" " visual records. Everything before\n" " this is just a jumble.\n\n" "61 ANOTHER ANGLE\n\n" " Picard stands.\n\n" " PICARD\n" " Proceed.\n\n" "62 DATA\n\n" " He inputs the computer pad in front of him.\n\n" "63 SCENE (OPTICAL)\n\n" " An image appears on the viewscreen. It's slightly\n" " distorted.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 22.\n\n" "63 CONTINUED:\n\n" " GEORDI\n" " The distortion is because we had\n" " to use a phase inverter to\n" " retrieve the logs. It will\n" " improve slightly.\n\n" " The image changes, but the quality does not noticeably\n" " improve.\n\n" "64 PICARD\n\n" " watches transfixed.\n\n" "65 SCREEN (OPTICAL)\n\n" " It's the shuttle's on-board camera. As the shuttle\n" " doors open, we see that the Enterprise is surrounded by\n" " a maelstrom of energy - a chaos of swirling, violent\n" " colors.\n\n" " The scene shifts, to a camera angle looking back at the\n" " Shuttle Bay. Riker is standing there. His expression\n" " is both pained and very concerned. He gives a little\n" " motion with his hand. It's difficult to tell the\n" " meaning of the motion.\n\n" "66 RIKER\n\n" " Here in the Observation Lounge, his face shows the same\n" " concern.\n\n" "67 THE SCREEN (OPTICAL)\n\n" " as the shuttle slowly leaves -- then quickly accelerates\n" " away until we see the Enterprise from the point of view\n" " of the shuttlecraft. It is surrounded by a swirling\n" " cacophony of energy and colors. It's like being on the\n" " edge of a great whirlpool. There is a lot of buffeting -- both\n" " the shuttle and the Enterprise are being thrown\n" " about.\n\n" "68 PICARD\n\n" " He is very intent on the scene before him.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 23.\n\n" "69 SCREEN (OPTICAL)\n\n" " The turmoil around the Enterprise increases. Then,\n" " without a sound... the Enterprise is literally torn\n" " apart, by a great, yet unseen force. Right on the\n" " screen -- before their eyes -- the ship is destroyed.\n" " Then the screen goes blank.\n\n" "70 REACTIONS FROM EVERYONE\n\n" " Picard turns away from the screen.\n\n" " DATA\n" " According to the shuttle log, the\n" " Enterprise was destroyed three\n" " hours, nineteen minutes from now.\n\n" " The room is silent for a beat, then:\n\n" " GEORDI\n" " Captain, we have a portion of your\n" " last log entry.\n\n" " PICARD\n" " Proceed.\n\n" " Data activates the control panel on the table in front\n" " of him.\n\n" " GEORDI\n" " It's audio only.\n\n" " There is a pause, then a strange phasing sound,\n" " followed by the distorted but understandable voice of\n" " Captain Picard. There is:\n\n" " PICARD (V.O.)\n" " Captain's personal log,\n" " supplemental.\n" " (there is a long pause)\n" " For the record... I have just\n" " witnessed the total destruction\n" " of the USS Enterprise with a loss\n" " of all hands, save one. Me.\n\n" " The entry ends with a very strange sound.\n\n" " DATA\n" " That last sound apparently\n" " occurred when the shuttle was\n" " thrown back in time.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 24.\n\n" "71 REACTIONS\n\n" " There is a long pause as those in the room try to\n" " absorb and comprehend what they have just seen.\n\n" " GEORDI\n" " All attempts to obtain additional\n" " information from the shuttle's\n" " logs have failed.\n\n" " Picard nods an acknowledgement.\n\n" " RIKER\n" " At least now we have something\n" " to go on.\n\n" " GEORDI\n" " I can't understand how you could\n" " end up in a shuttlecraft while\n" " the Enterprise is being destroyed.\n\n" " WORF\n" " Nor I, the last thing you would\n" " do is leave the bridge of the\n" " Enterprise during an emergency.\n\n" " PICARD\n" " Yes, but let's proceed on the\n" " premise that what we have just\n" " seen is factual and that somehow,\n" " in less than four hours, the\n" " Enterprise will be destroyed and\n" " somehow -- although this is\n" " unfathomable -- I, and I alone\n" " escaped. Discussion.\n\n" " RIKER\n" " Our destination is the Endicor\n" " system. We are not due to arrive\n" " for three days. The charts\n" " indicate nothing of consequence,\n" " certainly nothing which could\n" " threaten the Enterprise, between\n" " here and there.\n\n" " WORF\n" " Sensors indicated no other vessels\n" " -- Federation or otherwise -- in\n" " this area.\n\n" " PICARD\n" " Data?\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 24A.\n\n" "71 CONTINUED:\n\n" " DATA\n" " I have nothing to offer. There\n" " is not enough information upon\n" " which I can base a hypothesis.\n\n" " GEORDI\n" " Well, the shuttle apparently came\n" " from somewhere up ahead. Rather\n" " than continuing on this course,\n" " perhaps we should stop here and\n" " let whatever is out there come\n" " and find us.\n\n" " RIKER\n" " I think it's already too late for\n" " that.\n\n" " GEORDI\n" " Are you saying that stopping,\n" " turning left, or right, or even\n" " reversing course, is pointless?\n\n" " RIKER\n" " When we brought the shuttle and\n" " the other Picard on board, we\n" " committed ourselves to a sequence\n" " of events which may be\n" " unalterable.\n\n" " PICARD\n" " Yes, this isn't a rock in the road\n" " which once seen can be avoided.\n" " It's much more complex.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 25.\n\n" "71 CONTINUED: (2)\n\n" " WORF\n" " There is the theory of the\n" " moebius, a twist in the fabric of\n" " space where time becomes a loop\n" " from which there is no escape.\n\n" " GEORDI\n" " So, when we reach that moment --\n" " whatever happened will happen\n" " again... The Enterprise will be\n" " destroyed, the \"other Picard\" sent\n" " back to meet with us and do it\n" " all over again.\n" " (he shudders)\n" " That sounds like someone's\n" " definition of hell.\n\n" " RIKER\n" " I know this much -- we can't avoid\n" " the future.\n\n" " PICARD\n" " Agreed. So let's continue on\n" " course. Everyone return to your\n" " duty stations. Somewhere out\n" " there something will happen...\n" " a decision will be made which\n" " will cause me to become separated\n" " from the Enterprise -- at the time\n" " that decision will seem correct,\n" " but it won't be. We have to\n" " anticipate and not make the same\n" " mistake once. Something is\n" " waiting for us out there -- let's\n" " determine what it is as quickly\n" " as possible.\n\n" " Off their reactions:\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 26.\n\n" "72 INT. MAIN BRIDGE\n\n" " Riker, Worf ENTER and take their positions.\n\n" " Riker sits in the Command Chair and stares at the Main\n" " Viewer. Worf is intent upon his console. The tension\n" " level on the bridge is very high.\n\n" "73 INT. SHUTTLE BAY TWO\n\n" " Data is there with Geordi.\n\n" " GEORDI\n" " (he studies the shuttle)\n" " Data -- I think the molecular\n" " structure of the shuttle has\n" " changed!\n\n" " Data takes a tricorder and makes a scan.\n\n" " DATA\n" " Your assessment is accurate.\n\n" " GEORDI\n" " Why now?\n\n" " DATA\n" " Perhaps it always was unstable\n" " and it was only by leaving and\n" " coming back that you were able\n" " to see the change.\n\n" "74 INT. SICKBAY\n\n" " Pulaski is doing further tests on P2, as Picard ENTERS\n" " with Troi.\n\n" " PICARD\n" " Doctor?\n\n" " PULASKI\n" " I am beginning to realize just\n" " how much of the body is held\n" " together by its own internal\n" " clock. You -- he was thrown out\n" " of time, which caused the body\n" " systems to change their rhythms.\n" " Slowly, as we move closer to the\n" " time he left, the internal body\n" " clocks are realigning.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT TWO 27.\n\n" "74 CONTINUED:\n\n" " PICARD\n" " You're saying, when our time\n" " intersects with the time he left,\n" " at that instant he will be\n" " functioning normally. And there\n" " will be two of us.\n\n" " PULASKI\n" " Right now, that would be my guess.\n\n" " PICARD\n" " I don't believe that is possible.\n\n" " Pulaski pauses as the thought hits her.\n\n" " Troi has moved over closer to P2. She is watching him\n" " intently.\n\n" " TROI\n" " Captain, I am able to feel more\n" " from him now. Much of his\n" " emotions are still a jumble,\n" " but...\n\n" " She steps even closer. Her eyes shut as she\n" " concentrates. P2 flinches in the same stuttering way.\n" " His body jerks back. His face contorts.\n\n" " His hands reach out and grab Troi. For a moment\n" " nothing -- then she screams, in agony. P2... throws\n" " back his head but no sound comes out. Pulaski rushes\n" " to Troi. As she touches her, Troi collapses.\n\n" " PICARD\n" " What did you feel?\n\n" " TROI\n" " Only that he wants desperately\n" " to leave this ship.\n\n" " FADE OUT.\n\n" " END OF ACT TWO \n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 28.\n\n" " ACT THREE \n\n" " FADE IN:\n\n" "75 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " It continues on course.\n\n" " PICARD (V.O.)\n" " Captain's log, supplemental. We\n" " continue on course to Endicor.\n" " We are now less than two hours\n" " away from our rendezvous with\n" " ourselves.\n\n" "76 INT. MAIN BRIDGE\n\n" " Everyone is at his station except for Data.\n\n" " RIKER\n" " Worf.\n\n" " WORF\n" " All sensors are on maximum scan.\n" " There is nothing unusual to\n" " report.\n\n" " The tension level on the bridge is very high.\n\n" " RIKER\n" " If the timetable is correct, we\n" " should get an indication of\n" " something very soon.\n\n" " PULASKI'S COM VOICE\n" " Bridge, this is Sickbay.\n\n" " PICARD\n" " Yes, Doctor.\n\n" " PULASKI'S COM VOICE\n" " Captain, my patient is more\n" " coherent.\n\n" " PICARD\n" " I'll be right there.\n\n" " Picard rises and goes to the turbolift.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 29.\n\n" "76 CONTINUED:\n\n" " PICARD\n" " (continuing)\n" " Number One, you have the bridge.\n\n" " Off Riker's concerned reaction:\n\n" "77\n" "thru OMITTED\n" "78\n\n" "79 INT. SICKBAY (OPTICAL)\n\n" " Picard ENTERS. (He pauses at the doorway and watches\n" " Pulaski and P2).\n\n" " PICARD\n" " How is he?\n\n" " PULASKI\n" " His vital signs are more normal -- which\n" " is to say, more like ours.\n" " He is calmer.\n\n" " Indeed as Picard approaches him, P2 becomes more\n" " agitated.\n\n" " PICARD\n" " He is now aware of me.\n\n" " PULASKI\n" " In some fashion.\n\n" " PICARD\n" " (sotto, almost to\n" " himself)\n" " But, does he know where he is,\n" " and who's here with him?\n\n" " PULASKI\n" " I doubt it.\n\n" " PICARD\n" " (then to P2)\n" " What went wrong?\n\n" " P2 turns away. Like a bizarre painting by Goya, a\n" " face frozen in agony.\n\n" " Picard moves a step closer.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 30.\n\n" "79 CONTINUED:\n\n" " PICARD\n" " (continuing)\n" " You know... don't you?\n\n" " P2 turns back and faces Picard -- but his eyes still do\n" " not make contact. It's impossible to tell whether he\n" " hears Picard or not.\n\n" " PICARD\n" " (continuing)\n" " What did you do? What happened?\n" " Why did you leave the ship?\n\n" " P2 -- just trying to orient himself as much as anything -- turns\n" " his head.\n\n" " PICARD\n" " (continuing)\n" " Don't turn away. Look at me.\n\n" " Without being summoned, but somehow knowing that she is\n" " needed, Troi appears in the doorway behind them and\n" " slowly approaches as Picard continues to try and make\n" " contact.\n\n" " PICARD\n" " (continuing)\n" " Picard!\n\n" " He speaks the name as if it belongs to another, and at\n" " this moment it does.\n\n" " PICARD\n" " (continuing)\n" " LOOK AT ME!\n\n" " TROI\n" " He doesn't understand you.\n\n" " PICARD\n" " He knows I'm here.\n\n" " TROI\n" " Yes, as part of a nightmare of\n" " disjointed images, half-heard\n" " voices. He is in another\n" " dimension -- seeing us across a\n" " great chasm -- and he's filled with\n" " remorse at what he has witnessed,\n" " and he's afraid.\n\n" " PICARD\n" " What is he afraid of?\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 31.\n\n" "79 CONTINUED: (2)\n\n" " Troi doesn't have that specific answer.\n\n" " PICARD\n" " (continuing; back to\n" " P2)\n" " Damn you -- help me! Why did you\n" " leave the ship?\n\n" " Now, for the first time, P2 turns and looks Picard full\n" " in the face. Through what must be a blur of shifting\n" " and nightmarish images, P2 tries to focus.\n\n" "80 P2\n\n" " He leans forward. Like a sailor straining against the\n" " fog, then with a grimace made up of frustration and\n" " rage, he turns away. For the first time we hear a\n" " sound from his lips. It's strange -- otherworldish.\n\n" "81 SCENE\n\n" " Picard takes a step forward. For a second it looks as\n" " if Picard is going to grab P2 and shake him. But he\n" " only glares at him.\n\n" " TROI\n" " It's no use, Captain. He can't\n" " answer.\n\n" " PULASKI\n" " As we get closer to the time he\n" " left, he may be able to.\n\n" " Picard steps back, frustration etched on his face.\n\n" " PICARD\n" " (to Troi)\n" " Are you still convinced he is me?\n\n" " TROI\n" " Yes -- but you're not.\n\n" " PICARD\n" " Not in the slightest. Except for\n" " his features there is nothing\n" " about him which I find familiar.\n\n" " He turns to leave.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 31A.\n\n" "81 CONTINUED:\n\n" " PICARD\n" " (continuing)\n" " I want you to stay with him. He\n" " will be able to communicate with\n" " you before any of the rest of us.\n\n" " Picard then turns and EXITS.\n\n" " PULASKI\n" " I don't know how long anyone can\n" " take this kind of schizophrenia.\n" " There has to be a breaking point.\n\n" " TROI\n" " He is handling it very well.\n\n" " PULASKI\n" " He has a lot of anger.\n\n" " TROI\n" " Yes. Because of what...\n" " (indicating P2)\n" " ... he represents.\n\n" " PULASKI\n" " And what is that?\n\n" " TROI\n" " Doubt. Seeing him here and\n" " knowing what happened to the\n" " Enterprise could make him timid\n" " or, worse, cause him to hesitate.\n\n" " PULASKI\n" " When he said -- that there is\n" " nothing familiar about him...\n" " (re P2)\n" " ... except his features. It\n" " sounded like a form of denial.\n\n" " TROI\n" " It's his accurate feelings.\n\n" " PULASKI\n" " Part of my job is to anticipate\n" " problems. I have a duty to the\n" " captain, but first to the ship\n" " and its crew.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 31B.\n\n" "81 CONTINUED: (2)\n\n" " TROI\n" " Doctor, the captain is fully\n" " capable of command decisions.\n\n" " Pulaski is pensive for a beat.\n\n" " PULASKI\n" " Yes... for now. But... this\n" " situation has put enormous\n" " pressure -- of a unique and very\n" " personal nature -- on Captain\n" " Picard. And we both know that\n" " pressure is going to increase.\n" " You said he already has doubt.\n\n" " TROI\n" " Yes, which is necessary and\n" " healthy.\n\n" " PULASKI\n" " But could potentially paralyze.\n" " If we begin to see signs that he\n" " is acting in an irrational manner,\n" " then I have the authority and the\n" " duty to relieve him.\n\n" " Troi nods.\n\n" " TROI\n" " I do not think that will be\n" " necessary.\n\n" " PULASKI\n" " I hope you're right.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 32.\n\n" "82 OMITTED\n\n" "83 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " as it continues along -- without so much as a hint of\n" " trouble.\n\n" "84\n" "thru OMITTED\n" "87\n\n" "88 INT. CAPTAIN'S READY ROOM (OPTICAL)\n\n" " Picard is behind his desk -- Riker is sitting across\n" " from him.\n\n" " PICARD\n" " What force or phenomenon could\n" " cause a shuttle to be thrown back\n" " in time?\n\n" " RIKER\n" " None that we have ever\n" " encountered. In theory,\n" " accelerating beyond warp ten.\n\n" " PICARD\n" " Using the gravitational pull of\n" " a star to \"slingshot\" back in\n" " time. Is that what happened here?\n\n" " RIKER\n" " The shuttle doesn't have warp\n" " capability.\n\n" " PICARD\n" " No. Some external force was\n" " needed.\n\n" " RIKER\n" " We have never encountered any\n" " natural force that powerful. And\n" " why only six hours? Why not a\n" " day? A year?\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 33.\n\n" "88 CONTINUED:\n\n" " PICARD\n" " Are you suggesting there is a\n" " conscious mind at work here?\n\n" " RIKER\n" " There is no evidence either way.\n\n" " PICARD\n" " The Traveler moved through time\n" " with the power of his mind.\n\n" " RIKER\n" " I don't think that's the case\n" " here.\n\n" " PICARD\n" " (frustrated)\n" " No -- and Manheim's experiments\n" " with gravity and time were\n" " rudimentary, and uncontrollable.\n\n" " RIKER\n" " Captain, this is one instant\n" " where you must suppress your\n" " natural tendencies.\n\n" " PICARD\n" " Explain.\n\n" " RIKER\n" " (then more as a friend\n" " than a subordinate,\n" " or even a fellow\n" " officer)\n" " Your strength, Jean-Luc, is your\n" " ability to evaluate the dynamics\n" " of a situation, step in and make\n" " the definitive, preemptive move.\n" " You take charge. You're\n" " frustrated now because, not only\n" " can't you see the solution... you\n" " can't even define the problem.\n\n" " PICARD\n" " Go on.\n\n" " RIKER\n" " This is not place or person we\n" " are facing... at least not yet...\n" " it's time.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 34.\n\n" "88 CONTINUED: (2)\n\n" " PICARD\n" " Are you telling me to just sit\n" " down -- shut up and wait.\n\n" " Riker smiles.\n\n" " RIKER\n" " I wouldn't have used those exact\n" " words... but, yes.\n\n" " PICARD\n" " I don't do that well.\n\n" " RIKER\n" " It's your Persian Flaw.\n\n" " PICARD\n" " (thoughtfully)\n" " Yes -- perhaps it is.\n\n" " Sudden the Enterprise shudders. Both men are on their\n" " feet and heading for the door.\n\n" " WORF'S COM VOICE\n" " Captain to the bridge.\n\n" "89 INT. MAIN BRIDGE (OPTICAL)\n\n" " Riker and Picard EXIT the captain's Ready Room. On\n" " the Main Viewer they see the swirling energy which they\n" " saw in the shuttle's view log.\n\n" " PICARD\n" " Report.\n\n" " WORF\n" " This energy vortex appeared out\n" " of nowhere. There was no warning.\n\n" " RIKER\n" " Well, now at least the waiting\n" " is over.\n\n" "90 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " is at the top of a great whirlpool of energy.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT THREE 35.\n\n" "91 INT. MAIN BRIDGE\n\n" " Off Picard's reaction -- almost relieved.\n\n" " FADE OUT.\n\n" " END OF ACT THREE \n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 36.\n\n" " ACT FOUR \n\n" " FADE IN:\n\n" "92 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " at the top of the whirlpool.\n\n" " PICARD (V.O.)\n" " Captain's log, supplemental. The\n" " waiting is over. We have\n" " apparently intersected with...\n" " something.\n\n" "93 INT. MAIN BRIDGE\n\n" " Riker and Picard are back at Science One with Data.\n\n" " DATA\n" " It is similar to our tractor beam,\n" " only much more powerful.\n\n" "94 INTERCUT WITH MAIN ENGINEERING\n\n" " GEORDI'S COM VOICE\n" " Bridge, this is Engineering.\n\n" " RIKER\n" " This is the bridge.\n\n" " GEORDI'S COM VOICE\n" " The pull on the Enterprise is\n" " steady. I am having to hold the\n" " warp engines at thirty percent,\n" " in order to maintain this\n" " position.\n\n" " PICARD\n" " Transfer engine control to the\n" " bridge.\n\n" " GEORDI\n" " Aye, sir.\n\n" " Everyone is watching Picard -- waiting for an indication\n" " of what he wants to do next.\n\n" " TROI\n" " There is a consciousness here,\n" " Captain. Not thought -- it is more\n" " like instinct.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 37.\n\n" "94 CONTINUED:\n\n" " PICARD\n" " What do you make of it, Number\n" " One?\n\n" " RIKER\n" " I would say we're being probed.\n\n" " DATA\n" " The beam is coming directly from\n" " the center of the vortex. Sensors\n" " show only massive amounts of\n" " energy.\n\n" " PICARD\n" " What is it trying to learn?\n\n" " TROI\n" " I think it is trying to determine\n" " if we are a life force.\n\n" " PICARD\n" " (to Riker)\n" " We should stay and investigate.\n\n" " RIKER\n" " Agreed.\n\n" " PICARD\n" " But, was that the mistake?\n\n" " Riker looks at him.\n\n" " PICARD\n" " (continuing)\n" " ... staying too long.\n\n" " RIKER\n" " Possibly.\n\n" " PICARD\n" " We should go now.\n\n" " Riker is unsure of his response -- he has never seen\n" " Picard so indecisive. While this is going on, Geordi\n" " EXITS the turbolift and crosses to the bridge\n" " Engineering Station.\n\n" " RIKER\n" " Well...\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 38.\n\n" "94 CONTINUED: (2)\n\n" " PICARD\n" " It's the prudent move.\n\n" " Picard pauses.\n\n" " PICARD\n" " (continuing)\n" " I never thought I would hear\n" " myself say something like that.\n\n" " RIKER\n" " Under the circumstances -- I think\n" " you may be right.\n\n" " PICARD\n" " But you'd rather stay and find\n" " out what it is? What is its\n" " intent?\n\n" " Riker's silent hesitation is read as affirmation.\n\n" "95 INT. BRIDGE ENGINEERING STATION\n\n" " Geordi steps up to the position.\n\n" " GEORDI\n" " Engineering, transfer to bridge.\n\n" " The panels light up in sequence.\n\n" "96\n" "thru OMITTED\n" "99\n\n" "100 INT. MAIN BRIDGE\n\n" " Picard returns to his Command Chair.\n\n" " PICARD\n" " Lieutenant La Forge.\n\n" " GEORDI\n" " Yes, sir.\n\n" " PICARD\n" " See if you can get us out of here,\n" " Mister La Forge. Maximum warp.\n\n" " GEORDI\n" " Aye, sir.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 39.\n\n" "101 GEORDI\n\n" " as he inputs.\n\n" " GEORDI\n" " I have set velocity to warp nine.\n\n" " PICARD\n" " Engage.\n\n" " Geordi complies.\n\n" "102 SCENE\n\n" " There is a surge of power as the Enterprise attempts\n" " to pull free. Then nothing.\n\n" " GEORDI\n" " The warp engines are at ninety-one\n" " percent.\n\n" " PICARD\n" " Put it to the wall.\n\n" " GEORDI\n" " Aye, sir.\n\n" " Geordi inputs. The ship shudders -- like a great\n" " shackled animal fighting to break free.\n\n" " SUDDENLY the Enterprise shakes -- those standing are\n" " thrown to the deck. And AGAIN the ship shakes. The\n" " computer automatically takes the ship to RED ALERT.\n\n" " GEORDI\n" " (continuing)\n" " I can't hold it.\n\n" " RIKER\n" " Captain! The engines can't take\n" " this strain.\n\n" " PICARD\n" " All stop.\n\n" "103 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " But the Enterprise doesn't stop -- it instantly seems\n" " to fall -- drawn along the beam of energy by an\n" " irresistible force.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 40.\n\n" "104 INT. MAIN BRIDGE\n\n" " They have no control. Without having to be told,\n" " Geordi instantly tries to stop the Enterprise. His\n" " fingers fly over the controls.\n\n" "105 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " Warp engines re-engage. The Enterprise slows, then\n" " stops.\n\n" "106 INT. MAIN BRIDGE\n\n" " It's a little calmer, but still very tense.\n\n" " PICARD\n" " Status.\n\n" " WORF\n" " All decks have reported... no\n" " damage -- no injuries.\n\n" " GEORDI\n" " The pull on the Enterprise is\n" " steady, but much stronger than\n" " before. I am at warp seven just\n" " to hold this position.\n\n" " PICARD\n" " Everything we do tightens its\n" " grip. Let's see what we can\n" " learn. Launch a Class One probe.\n\n" " WORF\n" " Aye, sir.\n\n" "106A OMITTED\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 40A.\n\n" "107\n" "thru OMITTED\n" "108\n\n" "109 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " The probe leaves the Enterprise.\n\n" "110 INT. MAIN BRIDGE (OPTICAL)\n\n" " As they watch the Main Viewer -- as it reaches the\n" " vortex -- it explodes. Nothing is left.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 41.\n\n" "111 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " A little tongue of energy speeds up toward the\n" " Enterprise. Then splits, with half going to separate\n" " parts of the ship.\n\n" "112 INT. MAIN BRIDGE (OPTICAL)\n\n" " They see it racing toward them. The energy goes\n" " directly at Captain Picard and knocks him down.\n\n" "113 INT. SICKBAY (OPTICAL)\n\n" " A similar piece of energy leaps into the room, directly\n" " at P2... only it does not slap him to the deck. As\n" " Pulaski watches it whirls around P2, like a wreath,\n" " then disappears.\n\n" "114 INT. MAIN BRIDGE\n\n" " Riker helps Picard to his feet. There is fire in\n" " Picard's eyes.\n\n" " PICARD\n" " That was personal.\n\n" " GEORDI\n" " Captain -- the power drain needed\n" " to hold this position is enormous.\n\n" " PICARD\n" " How long can you maintain it?\n\n" " GEORDI\n" " A few minutes, then we are going\n" " to have to shut down again.\n\n" " PULASKI'S COM VOICE\n" " Captain -- some kind of energy has\n" " just surrounded my patient.\n\n" " PICARD\n" " Is he still alive?\n\n" " PULASKI'S COM VOICE\n" " Yes...\n\n" " RIKER\n" " Arm photons, Mister Worf, and lock\n" " them on the center of the vortex.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 42.\n\n" "114 CONTINUED:\n\n" " WORF\n" " Photon torpedoes locked on\n" " target.\n\n" " PICARD\n" " Hold.\n\n" "115 OMITTED\n\n" "116 INT. MAIN BRIDGE (OPTICAL)\n\n" " Another sliver of energy slashes across the bridge and\n" " slams Picard up against the bulkhead.\n\n" "117 PICARD\n\n" " ... dazed he struggles to his feet.\n\n" " RIKER\n" " We're like a rag in a dog's mouth.\n\n" " GEORDI\n" " I am now at maximum warp.\n\n" " The ship is hammered by another wave of energy.\n\n" " TROI\n" " It's you, Captain. It was the\n" " entire ship, but now it has turned\n" " its attention completely on you.\n\n" " GEORDI\n" " Captain, I can't hold it. If we\n" " don't shut down, we are going to\n" " explode.\n\n" " PICARD\n" " Counselor, what if I were to leave\n" " the Enterprise? Would its\n" " attention stay focused on me?\n\n" " TROI\n" " Yes. I think it would.\n\n" "118 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " is being pulled into the vortex.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FOUR 43.\n\n" "119 INT. MAIN BRIDGE\n\n" " as before.\n\n" " RIKER\n" " You'd never survive.\n\n" " PICARD\n" " But, maybe in those few seconds -- the\n" " Enterprise could break free.\n" " In any case, that's what he...\n" " the other Picard... must have\n" " thought.\n\n" "120\n" "thru OMITTED\n" "121\n\n" "122 PICARD\n\n" " He is on his feet and heading for the turbolift.\n\n" " RIKER\n" " Captain, where are you going?\n\n" " PICARD\n" " Prepare a shuttle, Number One.\n\n" " RIKER\n" " You're leaving the ship?!\n\n" " PICARD\n" " I have to make a stop in Sickbay.\n" " We may be on a road which has no\n" " turns.\n\n" " Troi follows Picard to the turbolift.\n\n" " Off Riker's reaction, we:\n\n" " FADE OUT.\n\n" " END OF ACT FOUR \n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 44.\n\n" " ACT FIVE \n\n" " FADE IN:\n\n" "123 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " is slipping down into the energy whirlpool.\n\n" "124 INT. SICKBAY (OPTICAL)\n\n" " Picard ENTERS -- Pulaski is there with Troi and P2.\n" " There is a moment of near recognition from P2, then he\n" " avoids eye contact with Picard. P2 now appears to be\n" " physically closer to normal. P2 is much closer to\n" " being in sync.\n\n" " PULASKI\n" " He's very agitated.\n\n" " P2's eyes dart around the room. Picard steps over in\n" " front of P2 to make and hold eye contact. P2 looks\n" " off.\n\n" "125 ANOTHER ANGLE - P2\n\n" " P2\n" " I must get to the shuttle.\n\n" "126 PICARD\n\n" " watches himself.\n\n" " PICARD\n" " I know.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 45.\n\n" "127 SCENE (OPTICAL)\n\n" " PICARD\n" " Do you know where you are?\n\n" " P2\n" " The Enterprise.\n\n" " Picard is relieved -\n\n" " PICARD\n" " But you're only vaguely aware of\n" " it. And me -- do you know who I\n" " am?\n\n" " P2 deflects the question. He's in a living nightmare.\n" " He has no answer.\n\n" " PICARD\n" " (continuing)\n" " No. You don't.\n\n" " P2\n" " I must go.\n\n" " P2 tries to rise.\n\n" " PICARD\n" " Release him.\n\n" " PULASKI\n" " Do you know what you are doing?\n\n" " PICARD\n" " No -- release him!\n\n" " Pulaski deactivates the forcefield, which again appears\n" " briefly, and P2 is released.\n\n" " PULASKI\n" " (touching her\n" " communicator)\n" " Security to Sickbay.\n\n" " PICARD\n" " No. Security, this is the\n" " captain -- disregard that order.\n" " And clear all personnel -- repeat,\n" " all personnel -- from Shuttle Bay\n" " Two. I don't want any\n" " distractions. You...\n" " (meaning both Troi and\n" " Pulaski)\n" " ... stay here.\n\n" " P2 and Picard head for the door.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE A45A. \n\n" "127A INT. CORRIDOR\n\n" " Picard and P2 walk along.\n\n" " PICARD\n" " You have made the decision to\n" " leave the ship?\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 45A.\n\n" "127A CONTINUED:\n\n" " P2\n" " I must.\n\n" " PICARD\n" " Why?\n\n" " P2\n" " The energy in the vortex wants\n" " me.\n\n" " PICARD\n" " You're certain.\n\n" " P2\n" " Yes... it's an entity -- a\n" " life-form which recognizes the\n" " Enterprise as an entity with me\n" " as the brain, and it wants me.\n\n" " P2's level of anxiety is rising, as they turn...\n\n" "127B INT. TURBOLIFT\n\n" " ... and enter the turbolift.\n\n" " P2\n" " Shuttle Bay Number Two.\n\n" " PICARD\n" " What's your other option?\n\n" " P2\n" " This is our only chance. If I\n" " leave, it might be distracted long\n" " enough for the Enterprise to\n" " escape.\n\n" " PICARD\n" " You are wrong. Leaving won't save\n" " your ship. Don't you remember?\n" " It was destroyed -- you saw it\n" " happen.\n\n" " P2\n" " If I don't leave the Enterprise,\n" " the ship will be destroyed.\n\n" " The turbolift comes to a stop and the doors open.\n" " EXITS, with Picard right behind him.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 45B.\n\n" "127BB INT. CORRIDOR\n\n" " Picard and P2 continue heading toward Shuttle Bay Two.\n\n" " PICARD\n" " If that's true, then help me.\n" " We want the same thing. We want\n" " the Enterprise to be safe.\n" " There has to be a piece of\n" " information which I don't have.\n" " What is it?\n\n" " P2\n" " It's me.\n\n" " PICARD\n" " You?\n\n" " They are interrupted by Riker's COM VOICE.\n\n" " RIKER\n" " Captain.\n\n" " PICARD\n" " Yes.\n\n" " RIKER\n" " We are about to lose warp drive.\n\n" " PICARD & P2\n" " (in sync, they respond\n" " to Riker)\n" " Understood.\n\n" " Only Picard reacts to this bizarre occurrence.\n\n" " PICARD\n" " (continuing)\n" " When you say it's \"you,\" do you\n" " mean it's still you? And it's\n" " not me -- just you. Has this\n" " entity singled you out -- somehow\n" " making a connection?\n\n" " P2\n" " You're confusing me. We're\n" " almost out of time.\n\n" "127C INT. SHUTTLE BAY TWO\n\n" " The doors open and the two Picards ENTER. P2 is\n" " heading directly for the shuttle.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 46.\n\n" "127C CONTINUED:\n\n" " P2\n" " I must get to the shuttle.\n\n" " PICARD\n" " Wait. You can -- I'll let you,\n" " hell, man, I'll go with you, but\n" " first tell me. What is -- what\n" " was, your other choice?\n\n" " P2\n" " Stand aside.\n\n" " PICARD\n" " You don't know what I'm talking\n" " about. You're frozen with a\n" " single thought -- unable to change -- unable\n" " to alter any part of your\n" " previous actions.\n\n" " P2\n" " I must leave -- there's no other\n" " way.\n\n" " PICARD\n" " There must be.\n\n" " P2\n" " Only one -- but it would never\n" " work.\n\n" " PICARD\n" " What is it? What would never\n" " work?\n\n" " P2\n" " Better to sacrifice myself than\n" " destroy the Enterprise.\n\n" " PICARD\n" " Destroy the Enterprise -- how?\n\n" " P2\n" " I have to leave.\n\n" " PICARD\n" " Tell me -- what was your other\n" " choice? We can't escape it -- we\n" " can't fight it, we can't go\n" " forward.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 46A.\n\n" "127C CONTINUED: (2)\n\n" " P2\n" " No -- no... We can't go forward,\n" " it would destroy the Enterprise.\n\n" " PICARD\n" " (realizing)\n" " Was that it... Was that the other\n" " choice?\n\n" " P2\n" " I must leave.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 47.\n\n" "127C CONTINUED: (3)\n\n" " PICARD\n" " No.\n\n" " P2 is about to climb into the shuttle. Picard pulls\n" " his phaser.\n\n" " PICARD\n" " (continuing)\n" " I can't allow it. Before we have\n" " any chance of moving forward, the\n" " cycle must end.\n\n" " Then, without further comment, he fires the phaser.\n\n" "128 OMITTED\n\n" "129 P2\n\n" " falls back.\n\n" "130 OMITTED\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 48.\n\n" "130A INT. SHUTTLE BAY TWO\n\n" " PICARD\n" " (touching his\n" " communicator)\n" " Doctor Pulaski -- report to Shuttle\n" " Bay Two.\n\n" " Picard heads for the door.\n\n" "131 INT. TURBOLIFT\n\n" " Picard steps on.\n\n" " PICARD\n" " Bridge.\n\n" " The doors close.\n\n" "132 INT. MAIN BRIDGE\n\n" " Picard steps off the turbolift.\n\n" " PICARD\n" " Number One, we have been wasting\n" " our energy trying to escape. It\n" " only weakens us.\n" " (he moves to his Command\n" " Chair)\n" " Helm, set a course for the center\n" " of the vortex. Lieutenant La\n" " Forge, on my command -- I want all\n" " the power you can muster.\n\n" " GEORDI\n" " Yes, sir.\n\n" " RIKER\n" " We are going into it?\n\n" " PICARD\n" " Yes.\n\n" " DATA\n" " Course set.\n\n" " PICARD\n" " Everyone hold your position -- no\n" " matter what. ENGAGE!\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 49.\n\n" "133 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " as the Enterprise turns and streaks toward the center\n" " of the vortex.\n\n" "133A INT. SHUTTLE BAY TWO\n\n" " Pulaski, followed by TRANSPORTER CHIEF O'BRIEN, ENTERS\n" " and reacts to the body.\n\n" "134 INT. MAIN BRIDGE\n\n" " They all tense for whatever is coming.\n\n" "135 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " rushes down. The funnel narrows. The swirling energy\n" " closes in on the ship.\n\n" "136 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " as the Enterprise rips into the center of the\n" " whirlpool. There is a SOUND -- almost like a SCREAM.\n\n" "137 INT. MAIN BRIDGE\n\n" " Everyone braces.\n\n" "138 EXT. SPACE - THE ENTERPRISE (OPTICAL)\n\n" " bursts through the core of pure energy, which triggers\n" " an implosion.\n\n" "139 OMITTED\n\n" "139A INT. SHUTTLE BAY TWO (OPTICAL)\n\n" " At this instant O'Brien watches as the body of P2 and\n" " the shuttle disappear.\n\n" "140 EXT. SPACE - THE WHIRLPOOL (OPTICAL)\n\n" " collapses in upon itself. For a beat the Enterprise is\n" " alone in a great emptiness.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 49A.\n\n" "141 INT. MAIN BRIDGE\n\n" " The reactions of everyone. Picard gets to his feet and\n" " looks around.\n\n" " PICARD\n" " What's our position?\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 50.\n\n" "141 CONTINUED:\n\n" " DATA\n" " We are back on course to Endicor.\n\n" " RIKER\n" " Stand down from Red Alert.\n\n" " O'BRIEN'S COM VOICE\n" " Bridge, this is Shuttle Bay Two.\n" " The other Picard and the shuttle\n" " are gone.\n\n" " PICARD\n" " Explain.\n\n" " O'BRIEN'S COM VOICE\n" " They just... vanished.\n\n" " WORF\n" " All decks have reported in. No\n" " damage -- no casualties.\n\n" " RIKER\n" " I want a complete check -- all\n" " systems.\n\n" " WORF\n" " Yes, sir.\n\n" " PICARD\n" " You have the bridge, Number One.\n\n" " Picard rises and heads for the Observation Lounge.\n" " Riker watches him leave.\n\n" "142 INT. OBSERVATION LOUNGE (OPTICAL)\n\n" " Picard stares thoughtfully out at the stars streaking\n" " by. After a beat, the door opens and Riker ENTERS.\n\n" " For a long moment nothing is said.\n\n" " PICARD\n" " Lots of questions, Number One...\n\n" " Riker nods in agreement.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 51.\n\n" "142 CONTINUED:\n\n" " PICARD\n" " (continuing)\n" " ... and damn few answers.\n\n" " There is a pause.\n\n" " RIKER\n" " Everything about it seemed a tick\n" " off.\n\n" " PICARD\n" " He certainly did not act like me,\n" " at least not the way I think I\n" " act.\n\n" " RIKER\n" " Maybe none of it was real... we\n" " could have just been part of a\n" " shared illusion.\n\n" " PICARD\n" " Or maybe \"he\" was thrown back in\n" " time so that we would be able to\n" " take another road... make another\n" " choice?\n\n" " RIKER\n" " That suggests a moral force,\n" " giving us the opportunity... or\n" " specifically giving you the\n" " opportunity to right a wrong.\n\n" " Picard is pensive for a moment.\n\n" " PICARD\n" " It's said... if you travel far\n" " enough you will eventually meet\n" " yourself.\n\n" " Picard turns and stares off at the stars.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 51A.\n\n" "142 CONTINUED: (2)\n\n" " PICARD\n" " (continuing)\n" " I will tell you this... it's a\n" " very unnerving experience, one\n" " I hope never to repeat.\n\n" " Off Picard with:\n\n" "142A INT. RIKER'S QUARTERS\n\n" " Riker has his cooking equipment in place. He has\n" " already placed all of the ingredients in a cooking\n" " utensil on the hot plate. The CHIME SOUNDS.\n\n" " RIKER\n" " Come.\n\n" " Worf ENTERS with Pulaski and Geordi.\n\n" " RIKER\n" " (continuing)\n" " I know you were all disappointed\n" " with my last culinary effort.\n\n" " WORF\n" " Not all.\n\n" " RIKER\n" " Thank you, Worf. Anyway,\n" " considering the stress of the last\n" " few days, I thought we could use\n" " a little diversion and at the same\n" " time I could make amends for the\n" " 'Owon omelet.\n\n" " PULASKI\n" " So what are you preparing?\n\n" " RIKER\n" " The specialty of the house,\n" " Alaskan stew.\n\n" " GEORDI\n" " Not with ingredients you picked\n" " up at Starbase seventy-three?\n\n" " RIKER\n" " No -- I had the computer fabricate\n" " everything. The potatoes, the\n" " onions, the flour, and the meat.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 51B.\n\n" "142A CONTINUED:\n\n" " WORF\n" " Meat? What kind of meat?\n\n" " RIKER\n" " Ahh... Well, to be authentic I\n" " needed moose. But, I couldn't\n" " find the specific molecular\n" " pattern for moose, so I had to\n" " improvise. The computer came\n" " close...\n\n" " Riker fills their plates.\n\n" " RIKER\n" " (continuing)\n" " ... actually, it's somewhere\n" " between venison -- musk ox -- and\n" " Kobe beef.\n\n" " WORF\n" " I thought that humans had long ago\n" " given up the practice of raising\n" " animals for food.\n\n" " RIKER\n" " There were a couple of winters\n" " when it was either starve or hunt.\n\n" " WORF\n" " How fortunate.\n\n" " Pulaski looks down at her plate.\n\n" " PULASKI\n" " I'll give you this -- your stew\n" " smells a lot better than the eggs.\n\n" " They taste it. Reactions around.\n\n" " PULASKI\n" " (continuing)\n" " This is quite good.\n\n" " GEORDI\n" " Agreed.\n\n" " Worf's expression is one of revulsion.\n\n" " RIKER\n" " No good, Worf.\n\n" " STAR TREK: \"Time Squared\" - REV. 2/7/89 - ACT FIVE 51C.\n\n" "142A CONTINUED: (2)\n\n" " WORF\n" " I appreciate the effort, I would\n" " have preferred another omelet.\n\n" " RIKER\n" " Sorry. I used the last of 'Owon\n" " eggs.\n\n" " GEORDI\n" " Thank goodness.\n\n" " Off their reactions:\n\n" " FADE OUT.\n\n" " END OF ACT FIVE \n\n" " THE END \n\n") matches = re.finditer(regex, test_str, re.MULTILINE | re.IGNORECASE) for matchNum, match in enumerate(matches, start=1): print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group())) for groupNum in range(0, len(match.groups())): groupNum = groupNum + 1 print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum))) # Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html