{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "58d0eb13",
   "metadata": {},
   "source": [
    "# Strings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "abf290f0",
   "metadata": {
    "tags": [
     "hide-cell"
    ]
   },
   "outputs": [],
   "source": [
    "import sys\n",
    "from pathlib import Path\n",
    "\n",
    "current = Path.cwd()\n",
    "for parent in [current, *current.parents]:\n",
    "    if (parent / '_config.yml').exists():\n",
    "        project_root = parent  # ← Add project root, not chapters\n",
    "        break\n",
    "else:\n",
    "    project_root = Path.cwd().parent.parent\n",
    "\n",
    "sys.path.insert(0, str(project_root))\n",
    "\n",
    "from shared import thinkpython, diagram, jupyturtle\n",
    "from shared.download import download\n",
    "\n",
    "# Register as top-level modules so direct imports work in subsequent cells\n",
    "sys.modules['thinkpython'] = thinkpython\n",
    "sys.modules['diagram'] = diagram\n",
    "sys.modules['jupyturtle'] = jupyturtle"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d74f8129",
   "metadata": {},
   "source": [
    "Strings are not like integers, floats, or booleans. A string is a **sequence**, which means it contains multiple values in a particular order. \n",
    "\n",
    "In this chapter, we'll learn how to access the individual values that comprise a string and utilize functions that process strings.\n",
    "\n",
    "We'll also utilize **regular expressions**, a powerful tool for identifying patterns in a string and performing operations such as search and replace.\n",
    "* **re.search(pattern, text)**\n",
    "* **|** alternative patter(s)\n",
    "* **^**\n",
    "* **$**\n",
    "* **re.sub(pattern, text, line**)\n",
    "\n",
    "As an exercise, you'll have a chance to apply these tools to perform text analysis, which should be inspirational in learning more about text-mining and eventually lead to language models."
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
