Split and join
split() on a separator, on whitespace and with a limit, unpacking fields into names, reading a whole log file line by line, join() to glue text back together, and partition() for key=value telemetry.
Open it in the simulatorStrings, split and join, then regular expressions from search to named groups, on a rocket launch log and a ship's GPS feed, ending in a log analyzer on a Raspberry Pi.
0 of 7 done
7 lessons in 4 chapters, about 5 hours on a simulated Raspberry Pi 4 Model B. Free, in your browser, every step checked by the simulator.
split() on a separator, on whitespace and with a limit, unpacking fields into names, reading a whole log file line by line, join() to glue text back together, and partition() for key=value telemetry.
Open it in the simulatorBrackets that capture: group() and groups(), turning a T-minus stamp into seconds, named groups and groupdict, findall with groups and non-capturing groups, back-references in re.sub, and finditer with positions.
Open it in the simulatorA ship's GPS feed in NMEA 0183: the XOR checksum that catches corrupted sentences, GGA fields by position, degrees and minutes to decimal degrees, a regex that validates and sorts sentence types, and speed and course from RMC.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
What a string really holds, and how to cut a line into fields.
One line of a rocket launch log, taken apart: repr and strip, indexing and slicing, find, in and count, why strings never change, format specs for tidy tables, and escape characters and raw strings.
0 of 6 steps
split() on a separator, on whitespace and with a limit, unpacking fields into names, reading a whole log file line by line, join() to glue text back together, and partition() for key=value telemetry.
0 of 6 steps
Describe text instead of spelling it out, and pull out the pieces.
Regular expressions with re: search and the Match object, character classes and repeats, anchors and MULTILINE, counted repeats and word boundaries, re.split and re.sub, and compiled patterns with flags.
0 of 6 steps
Brackets that capture: group() and groups(), turning a T-minus stamp into seconds, named groups and groupdict, findall with groups and non-capturing groups, back-references in re.sub, and finditer with positions.
0 of 6 steps
A launch log and a ship's GPS, turned from text into data.
A parser for the whole launch log: one regex per line into (time, system, message) records, telling comments from garbage, counting by system, formatting stamps back, timing events by pattern, and pulling a time window.
0 of 6 steps
A ship's GPS feed in NMEA 0183: the XOR checksum that catches corrupted sentences, GGA fields by position, degrees and minutes to decimal degrees, a regex that validates and sorts sentence types, and speed and course from RMC.
0 of 6 steps
A log analyzer that answers commands and lights an alarm.
Everything in one tool: load and parse the launch log, then answer typed commands (grep with any regex, a time window, ranked stats), survive a broken pattern, and light a red alarm LED when the log holds warnings.
0 of 7 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 7 lessons of Text and regular expressions are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Raspberry Pi 4 Model B with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 5 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: Split and join, Groups and Parsing NMEA lines.
With "Strings deep", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.