Post History
Bash, 28 bytes Takes input as a single binary string. grep -Po '(^|0)1(?!1)'|wc -l -P (non-standard) - use PCRE-compatible regex syntax -o (non-standard) - output each matching substring as...
#2: Post edited
- Bash, 28 bytes
- ---
Takes input as binary string.- ```
- grep -Po '(^|0)1(?!1)'|wc -l
- ```
- * `-P` (non-standard) - use PCRE-compatible regex syntax
- * `-o` (non-standard) - output each matching substring as separate line
- * `wc -l` - count lines
- Bash, 28 bytes
- ---
- Takes input as a single binary string.
- ```
- grep -Po '(^|0)1(?!1)'|wc -l
- ```
- * `-P` (non-standard) - use PCRE-compatible regex syntax
- * `-o` (non-standard) - output each matching substring as separate line
- * `wc -l` - count lines
