pyBegin / projects / regex-strip
🔣

Regex Strip

A small demonstration that reimplements Python's str.strip() method using regular expressions to remove leading and trailing whitespace.

23 linesRunnable

Regex Strip

A small demonstration that reimplements Python's str.strip() method using regular expressions to remove leading and trailing whitespace.

How to run

python regex-strip.py

Dependencies

Standard library only (uses re).

Pyodide-runnable

Yes - it is pure-stdlib code using only the re module and print.