Created
June 19, 2016 08:58
-
-
Save kijuky/449fdfcb52d3061abc75c1a54fa2c0bc to your computer and use it in GitHub Desktop.
ネストしたカッコの一番内側を取る
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> val str = "ab$(cd$(ef)gh)ij" | |
str: String = ab$(cd$(ef)gh)ij | |
scala> new scala.util.matching.Regex("""\)([^\)]*?)\(\$""").findFirstIn(str.reverse).get.reverse | |
res0: String = $(ef) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment