![]() | 1 doubleflower OP 自已解决了 (["'])(?:\\.|(?!\1).)*\1 |
![]() | 2 ngn999 2016-12-17 22:55:56 +08:00 ![]() |
![]() | 3 doubleflower OP |
![]() | 4 doubleflower OP |
![]() | 5 sagaxu 2016-12-18 10:42:18 +08:00 @doubleflower 遇到\"转义字符就不行了 |
![]() | 6 doubleflower OP @sagaxu 哈哈源代码里不准用\",所以不考虑这个问题。(我想了下考虑进去也能做到,只是更复杂了) |
7 icris 2016-12-18 15:39:29 +08:00 ![]() (['"]).*?\1 |
8 stormhouse 2016-12-19 09:00:42 +08:00 您这是要做词法分析吗 |
![]() | 9 chnhyg 2016-12-19 13:48:37 +08:00 (['"])([^\1]+?)\1 |
![]() | 10 chnhyg 2016-12-19 13:59:12 +08:00 好像在中括号内不能用 \1 ,被转义了。 |
![]() | 12 ares951753 2016-12-19 14:23:08 +08:00 same question [here][1] [1]: http://stackoverflow.com/questions/24079995/regex-multiple-quotes-selection |