{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "aafb1f15-45aa-4a16-ad58-446108ced758",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cd8e1b03-9968-49ec-ac54-bb82b40fa56f",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "59b7540a-2d6e-4dfe-a3c4-317fb6f4f41b",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "test1=\"@DF-UHF Final Energy:  -256.97552605980593\"\n",
    "test2=\"Total Energy =                       -256.9755260598059294\"\n",
    "test3=\"  Total Energy              =    -257.3508759806243802 [H]\"\n",
    "test4=\" SCS Total Energy          =    -257.3364735188125110 [H]\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "cb4ce7f9-1cf7-40be-92e0-d04039a7cce3",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "x1=re.compile(\".*Energy.*\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5bc84902-b7ec-40f2-8256-e0aa9b9de54f",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<re.Match object; span=(0, 42), match='@DF-UHF Final Energy:  -256.97552605980593'>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m1=x1.match(test1)\n",
    "m1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "b69d0e7f-80c1-452e-8306-c4d81db7ba3c",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<re.Match object; span=(0, 58), match='Total Energy =                       -256.9755260>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1.match(test2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9a39db3e-73e9-4a09-a266-364279d2aad8",
   "metadata": {},
   "source": [
    "## quantificatori ##"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "74598709-35f5-4829-8d9f-f73304776e57",
   "metadata": {},
   "outputs": [],
   "source": [
    "x2=re.compile(\" *Total Energy\")\n",
    "x3=re.compile(\" +Total Energy\")\n",
    "x4=re.compile(\" {2,}Total Energy\")\n",
    "x5=re.compile(\" ?Total Energy\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "98a294ca-d3b4-4861-8a28-36597ff342c0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<regex.Match object; span=(0, 14), match='  Total Energy'>\n",
      "<regex.Match object; span=(0, 14), match='  Total Energy'>\n",
      "<regex.Match object; span=(0, 14), match='  Total Energy'>\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "for x in [x2, x3, x4, x5]:\n",
    "    print(x.match(test3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "1b0282bb-9f55-45bc-9160-80e7bfac19f3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<regex.Match object; span=(0, 12), match='Total Energy'>\n",
      "None\n",
      "None\n",
      "<regex.Match object; span=(0, 12), match='Total Energy'>\n"
     ]
    }
   ],
   "source": [
    "for x in [x2, x3, x4, x5]:\n",
    "    print(x.match(test2))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1337ed49-885e-47f3-8ebb-b7ce80103c90",
   "metadata": {},
   "source": [
    "## gruppi ##\n",
    "\n",
    "(a)*\n",
    "\n",
    "(a|b)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dbee1fce-1581-4495-b68b-a129e255391d",
   "metadata": {},
   "outputs": [],
   "source": [
    "\"(e|E)nergy\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "a52a7a38-ddf9-4488-86b4-64ca0f4d3473",
   "metadata": {},
   "outputs": [],
   "source": [
    "x6=re.compile(\" *Total Energy *= *([^ ]+)\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e87a2d21-2fe5-4dbe-afca-5ba3c6ade666",
   "metadata": {},
   "outputs": [],
   "source": [
    "\"[0-9.e+-]*\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "67711c6d-39d1-4acb-b190-6d101db7c3f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<regex.Match object; span=(0, 54), match='  Total Energy              =    -257.3508759806243802'>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m6=x6.match(test3)\n",
    "m6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "dfb0f08f-d6fa-498e-8a69-c1d7c85bc8ad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('-257.3508759806243802',)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m6.groups()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "7ac149f6-ae5f-464e-af3c-1fd044c8ffd7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'  Total Energy              =    -257.3508759806243802'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m6.group(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "d6dfeb69-e518-4ce8-887d-e4b6539bce3a",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "ename": "error",
     "evalue": "unknown extension ?<e at position 20",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31merror\u001b[0m                                     Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[20], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m x7\u001b[38;5;241m=\u001b[39m\u001b[43mre\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcompile\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m *Total Energy *= *(?<en>[^ ]+)\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m/usr/lib/python3.11/re/__init__.py:227\u001b[0m, in \u001b[0;36mcompile\u001b[0;34m(pattern, flags)\u001b[0m\n\u001b[1;32m    225\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcompile\u001b[39m(pattern, flags\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m):\n\u001b[1;32m    226\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCompile a regular expression pattern, returning a Pattern object.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m--> 227\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_compile\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpattern\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mflags\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m/usr/lib/python3.11/re/__init__.py:294\u001b[0m, in \u001b[0;36m_compile\u001b[0;34m(pattern, flags)\u001b[0m\n\u001b[1;32m    288\u001b[0m     \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mwarnings\u001b[39;00m\n\u001b[1;32m    289\u001b[0m     warnings\u001b[38;5;241m.\u001b[39mwarn(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe re.TEMPLATE/re.T flag is deprecated \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m    290\u001b[0m               \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mas it is an undocumented flag \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m    291\u001b[0m               \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwithout an obvious purpose. \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m    292\u001b[0m               \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mDon\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt use it.\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m    293\u001b[0m               \u001b[38;5;167;01mDeprecationWarning\u001b[39;00m)\n\u001b[0;32m--> 294\u001b[0m p \u001b[38;5;241m=\u001b[39m \u001b[43m_compiler\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcompile\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpattern\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mflags\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    295\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m (flags \u001b[38;5;241m&\u001b[39m DEBUG):\n\u001b[1;32m    296\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(_cache) \u001b[38;5;241m>\u001b[39m\u001b[38;5;241m=\u001b[39m _MAXCACHE:\n\u001b[1;32m    297\u001b[0m         \u001b[38;5;66;03m# Drop the oldest item\u001b[39;00m\n",
      "File \u001b[0;32m/usr/lib/python3.11/re/_compiler.py:743\u001b[0m, in \u001b[0;36mcompile\u001b[0;34m(p, flags)\u001b[0m\n\u001b[1;32m    741\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m isstring(p):\n\u001b[1;32m    742\u001b[0m     pattern \u001b[38;5;241m=\u001b[39m p\n\u001b[0;32m--> 743\u001b[0m     p \u001b[38;5;241m=\u001b[39m \u001b[43m_parser\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mparse\u001b[49m\u001b[43m(\u001b[49m\u001b[43mp\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mflags\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    744\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m    745\u001b[0m     pattern \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n",
      "File \u001b[0;32m/usr/lib/python3.11/re/_parser.py:980\u001b[0m, in \u001b[0;36mparse\u001b[0;34m(str, flags, state)\u001b[0m\n\u001b[1;32m    977\u001b[0m state\u001b[38;5;241m.\u001b[39mflags \u001b[38;5;241m=\u001b[39m flags\n\u001b[1;32m    978\u001b[0m state\u001b[38;5;241m.\u001b[39mstr \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mstr\u001b[39m\n\u001b[0;32m--> 980\u001b[0m p \u001b[38;5;241m=\u001b[39m \u001b[43m_parse_sub\u001b[49m\u001b[43m(\u001b[49m\u001b[43msource\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mflags\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m&\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mSRE_FLAG_VERBOSE\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m    981\u001b[0m p\u001b[38;5;241m.\u001b[39mstate\u001b[38;5;241m.\u001b[39mflags \u001b[38;5;241m=\u001b[39m fix_flags(\u001b[38;5;28mstr\u001b[39m, p\u001b[38;5;241m.\u001b[39mstate\u001b[38;5;241m.\u001b[39mflags)\n\u001b[1;32m    983\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m source\u001b[38;5;241m.\u001b[39mnext \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
      "File \u001b[0;32m/usr/lib/python3.11/re/_parser.py:455\u001b[0m, in \u001b[0;36m_parse_sub\u001b[0;34m(source, state, verbose, nested)\u001b[0m\n\u001b[1;32m    453\u001b[0m start \u001b[38;5;241m=\u001b[39m source\u001b[38;5;241m.\u001b[39mtell()\n\u001b[1;32m    454\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m--> 455\u001b[0m     itemsappend(\u001b[43m_parse\u001b[49m\u001b[43m(\u001b[49m\u001b[43msource\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mverbose\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnested\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m    456\u001b[0m \u001b[43m                       \u001b[49m\u001b[38;5;129;43;01mnot\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mnested\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mand\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mnot\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mitems\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[1;32m    457\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m sourcematch(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m|\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m    458\u001b[0m         \u001b[38;5;28;01mbreak\u001b[39;00m\n",
      "File \u001b[0;32m/usr/lib/python3.11/re/_parser.py:764\u001b[0m, in \u001b[0;36m_parse\u001b[0;34m(source, state, verbose, nested, first)\u001b[0m\n\u001b[1;32m    762\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m source\u001b[38;5;241m.\u001b[39merror(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124munexpected end of pattern\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m    763\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m char \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m=!\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[0;32m--> 764\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m source\u001b[38;5;241m.\u001b[39merror(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124munknown extension ?<\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m+\u001b[39m char,\n\u001b[1;32m    765\u001b[0m                        \u001b[38;5;28mlen\u001b[39m(char) \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m2\u001b[39m)\n\u001b[1;32m    766\u001b[0m \u001b[38;5;28mdir\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m \u001b[38;5;66;03m# lookbehind\u001b[39;00m\n\u001b[1;32m    767\u001b[0m lookbehindgroups \u001b[38;5;241m=\u001b[39m state\u001b[38;5;241m.\u001b[39mlookbehindgroups\n",
      "\u001b[0;31merror\u001b[0m: unknown extension ?<e at position 20"
     ]
    }
   ],
   "source": [
    "x7=re.compile(\" *Total Energy *= *(?<en>[^ ]+)\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "7f0a644b-a2f8-4bc6-bb94-0f2bffbd9023",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'-257.3508759806243802'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x7.match(test3).group('en')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "2397c800-4118-4568-ae70-0983f01c1c58",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-256.9755260598059294\n",
      "\n",
      "-256.9761552802447682\n",
      "\n",
      "-256.9766274943673352\n",
      "\n",
      "-256.9769754819488412\n",
      "\n",
      "-256.9772261724594955\n",
      "\n",
      "-256.9774016826107186\n",
      "\n",
      "-256.9775200881382489\n",
      "\n",
      "-256.9775960237619756\n",
      "\n",
      "-256.9776411775564497\n",
      "\n",
      "-256.9776647214655441\n",
      "\n",
      "-256.9776737006485519\n",
      "\n",
      "-256.9776590946204919\n",
      "\n",
      "-256.9776495932217699\n",
      "\n",
      "-256.9776402545101064\n",
      "\n",
      "-256.9776317272155666\n",
      "\n",
      "-256.9776243241889802\n",
      "\n",
      "-256.9776181366410128\n",
      "\n",
      "-256.9776131195372386\n",
      "\n",
      "-256.9776091528333950\n",
      "\n",
      "-256.9776060834180385\n",
      "\n"
     ]
    }
   ],
   "source": [
    "with open('Ne2.out') as f:\n",
    "    for l in f:\n",
    "        m=x7.match(l)\n",
    "        if m:\n",
    "            print(m.group('en'))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "31f03253-aa0d-4c40-924d-2c64c063284b",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "test_coord=\"     NE     0.0000 0.0000 0.00000\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "6e57ea08-bb06-4fa6-ab20-0aeed9476b73",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "cr1=re.compile(\" +NE +([^ ]*) +([^ ]*) +([^ ]*)\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "82a8279c-3da4-46ae-9953-f6725d82fd1a",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<re.Match object; span=(0, 33), match='     NE     0.0000 0.0000 0.00000'>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cr1m=cr1.match(test_coord)\n",
    "cr1m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "555eebea-3645-4987-a241-d0fe3b4ca9ec",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('0.0000', '0.0000', '0.00000')"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cr1m.groups()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "dd303372-f5c7-420e-baab-ed73da0e4730",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('0.0000', '0.0000', '0.00000')"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cr2=re.compile(\" +NE +(?P<x>[^ ]+) +(?P<y>[^ ]+) +(?P<z>[^ ]+)\")\n",
    "cr2m=cr2.match(test_coord)\n",
    "cr2m.groups()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "1f6a6e94-96f0-4c26-8a0a-ed307a1b19b8",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'0.0000'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cr2m.group('x')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "9444fa69-8917-4a70-8190-35715318bf47",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('0.000000000000', '0.000000000000', '-1.150000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.150000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.175000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.175000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.200000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.200000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.225000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.225000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.250000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.250000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.275000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.275000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.300000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.300000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.325000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.325000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.350000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.350000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.375000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.375000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.400000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.400000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.475000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.475000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.500000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.500000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.525000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.525000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.550000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.550000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.575000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.575000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.600000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.600000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.625000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.625000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.650000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.650000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '-1.675000000000\\n')\n",
      "('0.000000000000', '0.000000000000', '1.675000000000\\n')\n"
     ]
    }
   ],
   "source": [
    "with open('Ne2.out') as f:\n",
    "    for l in f:\n",
    "        m=cr1.match(l)\n",
    "        if m:\n",
    "            print(m.groups())\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b4495121-4d47-4b39-95df-703cc848c9d9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
