我有一个pandas'DataFrame
,它看起来像这样:
# Output
# A B C D
# 0 3.0 6.0 7.0 4.0
# 1 42.0 44.0 1.0 3.0
# 2 4.0 2.0 3.0 62.0
# 3 90.0 83.0 53.0 23.0
# 4 22.0 23.0 24.0 NaN
# 5 5.0 2.0 5.0 34.0
# 6 NaN NaN NaN NaN
# 7 NaN NaN NaN NaN
# 8 2.0 12.0 65.0 1.0
# 9 5.0 7.0 32.0 7.0
# 10 2.0 13.0 6.0 12.0
# 11 NaN NaN …
Run Code Online (Sandbox Code Playgroud) 我试图匹配JavaScript中最后一次出现的字符串之后的所有内容(但不包括!)。
例如,搜索为:
[quote="user1"]this is the first quote[/quote]\n[quote="user2"]this is the 2nd quote and some url https://www.google.com/[/quote]\nThis is all the text I\'m wirting about myself.\n\nLook at me ma. Javascript.
Run Code Online (Sandbox Code Playgroud)
编辑:我正在寻找匹配最后一个引号块之后的所有内容。所以我想匹配最后一次出现的“ quote]”之后的所有内容吗?Idk,如果这是最好的解决方案,但我一直在尝试。
老实说,我很喜欢Regex的东西..这就是我一直在尝试的结果。
regex = /(quote\].+)(.*)/ig; // Returns null
regex = /.+((quote\]).+)$/ig // Returns null
regex = /( .* (quote\]) .*)$/ig // Returns null
Run Code Online (Sandbox Code Playgroud)
我制作了一个JSfiddle,供任何人在这里玩: