Skip to content

Instantly share code, notes, and snippets.

@TimLang
Last active January 3, 2016 10:49
Show Gist options
  • Save TimLang/8452384 to your computer and use it in GitHub Desktop.
Save TimLang/8452384 to your computer and use it in GitHub Desktop.
split by "\d\.
"dsdsd1.xsds\ndsdsd\n2.dsds6dsd".split(/(?=\d\.(?!\d\.).+)/)
#["dsdsd", "1.xsds\ndsdsd\n", "2.dsds6dsd"]
#"ds32sdsd22.xsds\nd6sdsd\n11.dsds6dsd".split(/(?=[\d]{1,2}\.(?![\d]\.).+)/)
#(?=[\n\s]+[\d]+[\.](?![\d]{1,2}[\.]).+)
#aaaaa\n 1.--------\n\n 32.------\n\n 3.-----2.7+8。9----2\n 24.---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment