|
Download code/code031.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 2.18 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/code/code031.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/code/code031.jsonl
-
curl -L -o code031.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/code/code031.jsonl
2.18 kB
| {"type": "session", "harness": "deepseek-harness", "id": "code031", "name": "Regular expressions basics"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}} | |
| {"type": "message", "message": {"role": "user", "content": "What are regular expressions and how do I use them?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "**Basic Patterns:**\n```python\nimport re\n\n# Literal match\nre.findall(r\"cat\", \"cat bat sat\") # ['cat']\n\n# Any character (except newline)\nre.findall(r\".at\", \"cat bat sat\") # ['cat', 'bat', 'sat']\n\n# Digit\nre.findall(r\"\\d\", \"abc123\") # ['1', '2', '3']\n\n# Word character (letter, digit, underscore)\nre.findall(r\"\\w+\", \"hello world\") # ['hello', 'world']\n\n# Whitespace\nre.findall(r\"\\s\", \"a b c\") # [' ', ' ']\n```\n\n**Quantifiers:**\n```python\nre.findall(r\"ab*c\", \"ac abc abbc\") # ['ac', 'abc', 'abbc']\nre.findall(r\"ab+c\", \"ac abc abbc\") # ['abc', 'abbc']\nre.findall(r\"ab?c\", \"ac abc\") # ['ac', 'abc']\nre.findall(r\"ab{2}c\", \"abc abbc\") # ['abbc']\n```\n\n**Anchors:**\n```python\nre.findall(r\"^hello\", \"hello world\") # ['hello'] (start)\nre.findall(r\"world$\", \"hello world\") # ['world'] (end)\n```\n\n**Character Classes:**\n```python\nre.findall(r\"[aeiou]\", \"hello\") # ['e', 'o']\nre.findall(r\"[a-z]\", \"Hello\") # ['e', 'l', 'l', 'o']\nre.findall(r\"[^0-9]\", \"abc123\") # ['a', 'b', 'c']\n```\n\n**Groups:**\n```python\nre.findall(r\"(\\d+)-(\\d+)\", \"123-456\") # [('123', '456')]\nre.search(r\"(\\d+)\", \"abc 123 def\") # <Match: '123'>\n```\n\n**Common Patterns:**\n```python\n# Email (simple)\nre.findall(r\"[\\w.+-]+@[\\w-]+\\.[\\w.]+\", text)\n\n# Phone number\nre.findall(r\"\\d{3}-\\d{3}-\\d{4}\", text)\n\n# URL\nre.findall(r\"https?://\\S+\", text)\n```"}} | |