我有一个非常简单的问题:
初始化下面的变量会导致编译错误......出现以下错误消息"字符串太长。给定的字符串长度为67345个Unicode代码单元,但最多只允许65535个。"
def tooLargeString =' {" GLOBAL_PERF":[{" name":" ALOS_Login"," baselineDays":[ [93280.8,94741.9,97125.5,97408.4,100993.9,97730.3,97099.1],[93222.0,93391.8,94716.7,97369.1,99379.6,97307.0,97346.1],[93851.4,93871.6,92630.9,97185.6,98974.5,98430.1,96912.7],[94263.5] ,92862.8,92567.7,97015.0,98540.5,97869.6,97256.2],[93386.5,92545.9,92484.8,96589.6,99146.6,97238.1,96544.9],[92980.3,92584.5,91883.8,97227.9,98361.0,97137.1,96360.5],[93628.4,92937.2] ,92444.5,97543.0,99683.6,97436.3,95943.3],[93795.1,92961.8,92528.3,96820.6,99207.1,97154.2,96830.8],[93814.6,92797.9,92211.2,97218.7,99487.0,96896.0,96206.4],[95168.4,93439.7,96504.6] ,98899.0,99458.4,97100.6,96738.8],[95753.3,95284.5,97641.3,98817.2,101607.7,97491.4,95684.8],[95534.5,95325.3,97252.0,100793.7,98332.7,97334.8,95023.6],[95215.4,94777.7,97245.3,99282.8] ,98867.8,98395.5,95358.9],[95404.0,94792.8,97651.3,99336.5, 97989.9,98077.0,95174.0],[96594.4,95023.1,99065.5,99490.0,98524.3,97397.0,95786.5],[95511.3,94407.0,98463.3,99869.4,98156.8,97080.0,95426.1],[95852.4,94960.3,98697.5,99857.7,99042.5, 96939.1,95272.0],[96609.6,94914.0,97234.8,100705.1,98959.5,97722.1,95321.5],[96577.3,95266.8,97563.6,102401.3,98387.0,96734.7,95771.2],[96368.6,96217.3,97477.0,101024.0,97923.2,96901.0, 95124.3],[94787.8,97512.9,97958.4,100494.3,98060.1,96489.5,94785.9],[93828.8,100014.7,99883.2,103011.7,98500.6,97764.8,94732.8],[94066.4,97185.8,98133.5,101204.6,97891.1,96835.8,94080.7] ,[94718.8,96243.6,97350.4,100178.7,98308.2,97794.0,94972.0]]},{" name":" ALS_ProxyTest"," baselineDays":[[655.9] ,946.3,699.8,622.7,645.2,550.1,549.0],[670.5,692.6,724.3,653.3,630.0,583.1,560.3],[641.5,682.7,864.1,644.4,577.0,566.9,550.9],[667.3,745.6] ,753.5,643.2,588.8,578.9,558.0],[687.9,712.6,738.3,631.4,656.0,560.8,5 57.0],[660.4,722.3,853.9,636.0,639.1,610.5,558.0],[683.3,837.4,792.0,616.8,639.7,570.1,581.9],[701.4,782.8,988.4,611.0,633.2,561.0,546.5] ,[691.8,718.6,752.4,633.7,632.3,562.0,578.0],[691.0,865.9,1606.9,672.6,667.9,561.9,567.0],[694.5,813.3,690.3,665.5,673.5,566.8,553.3],[ 701.5,741.3,832.9,777.6,802.9,532.6,559.5],[672.4,891.3,673.4,646.8,718.0,575.3,575.1],[954.8,840.2,732.3,877.7,666.2,591.8,573.5],[892.4, 793.9,757.2,687.8,691.9,586.5,563.5],[994.0,837.0,815.2,793.3,716.3,560.1,551.4],[898.6,834.2,773.3,692.0,715.0,562.0,567.7],[1014.6,1107.0, 684.2,684.5,739.6,590.3,546.6],[713.8,816.9,669.5,1771.1,563.9,648.4,567.3],[807.9,706.3,806.2,643.8,641.5,1149.6,574.4],[730.9,1179.2,733.9, 669.6,608.4,654.6,564.7],[995.3,2549.3,929.8,862.8,579.9,571.1,612.5],[943.4,1874.4,702.1,688.0,579.6,840.9,564.4],[722.9,682.7,668.0,619.2, 563.3,567.6,581.3]]},{" name" :" Homes_LogingBE"," baselineDays":[[21244.8,26398.2,31389.3,13543.5,13811.0,14034.7,14131.8],[22492.1,26249.7,31276.9,13834.9,14213.3,13760.4,13486.5 ],[23634.4,27846.2,33580.0,13737.1,14137.9,13910.5,13592.0],[21846.6,26669.2,30777.8,13628.8,13854.4,13702.5,13586.4],[21962.6,26423.8,31396.9,13440.0,13893.1,13776.4,13787.5], [21546.3,25818.3,32862.1,13264.9,13691.9,14025.4,13704.2],[22147.8,25311.5,34814.3,13520.6,13488.1,13467.0,13584.3],[21404.2,30001.4,34246.3,13492.7,13623.9,13464.4,13568.6],[21486.8] ,28396.8,3342.7,13666.0,13740.7,13549.8,13651.0],[23005.2,30783.9,18951.3,13744.6,13935.7,13823.5,13526.3],[21108.6,30422.6,14003.3,13520.3,13389.2,13814.6,13639.0],[22985.8,29195.7] ,13761.0,13603.7,13975.0,14209.3,13826.3],[22479.7,28259.2,13919.9,13940.5,13899.1,13983.2,13610.5],[22196.2,29774.1,13825.4,14230.7,13670.8,13782.5,13722.2],[24462.9,29805.8,14138.0] ,13896.7,13 669.1,13647.3,13644.8],[22672.2,30084.7,13786.5,13619.0,13491.7,13588.7,13770.3],[23509.2,32498.5,13899.0,1369.6.6,14000.0,13877.3,13438.6],[23760.5,31145.2,13945.2,13774.3,13954.9, 14034.8,13821.8],[21812.7,31364.0,14060.6,14357.7,13641.3,13968.4,13725.8],[24734.6,28532.0,1362.1.1,13896.1,13500.3,13978.2,13920.2],[23978.8,32638.4,14249.4,14258.7,13621.3,13733.7, 14025.6],[26078.2,30315.0,14172.2,13750.3,13715.5,15034.9,13639.0],[25697.2,31795.7,13140.8,13948.5,13917.0,13906.8,13847.7],[24817.3,3164.48,13458.8,13855.3,13949.5,13351.1,13710.9] ]},... {" name":" Scada_SWORDAS"," baselineDays":[[16368.8,16945.5,21055.0,15001.9,14998.8,14302.4,14862.2] ,[18952.7,18338.1,19326.3,16850.4,15422.6,14491.1,15465.5],[18775.5,18456.0,21693.7,28809.9,15131.9,15628.4,14680.0],[17718.1,18722.3,1990.78,24651.7,15931.3,14432.0,14622.3],[ 18184.6,17555.5,21642.0,17500.2,15458.8,14535.2,14210 .0],[18725.5,18799.9,22388.5,17080.3,15404.5,14172.3,14066.2],[18214.1,17573.5,22124.8,18082.2,14771.6,14127.0,14109.2],[19043.5,19999.2,22768.0,18249.7,15472.9,14460.0,14544.5 ],[18772.9,20561.4,21675.8,15417.0,15974.4,14438.3,13458.6],[23104.8,24288.2,1990,4.4,15783.4,15180.0,15040.5,14608.3],[18507.8,20486.2,15135.2,16404.0,15084.8,14557.2,14285.7], [19961.3,20651.0,14943.0,15135.4,14925.5,14449.5,14183.9],[17966.8,19517.8,15183.0,14812.2,14577.3,14492.5,14015.0],[18166.6,21157.7,14693.5,16337.2,14270.6,14930.2,14427.5],[19154.9] ,18565.7,15318.5,14914.6,14542.3,15221.4,15007.4],[22086.7,24164.6,18619.5,17037.0,14486.4,14439.7,15035.0],[23285.1,25943.9,20656.2,18960.6,15100.8,14486.0,15210.0],[21571.0,22192.4] ,16442.8,16084.2,14446.6,14067.9,15454.2],[20494.0,18674.8,15177.5,15287.5,13804.6,14502.4,14296.8],[19094.9,19349.3,15633.3,14849.0,14537.7,14775.2,14687.5],[19856.2,20010.4,1 6157.0,13998.1,15622.7,15073.3,14845.5],[18296.5,18679.9,14662.5,15596.6,14354.2,14793.0,14322.6],[20261.4,2002.6.6,14943.9,16516.0,14423.1,15086.3,14033.0],[19257.1,18178.0,15468.4, 15851.5,14175.6,14821.5,15025.0]]},{" name":" Scada_SWORDEU"," baselineDays":[[7128.8,10512.0,14019.8,3935.9,4593.3 ,4138.5,4517.0],[8003.6,7938.1,12911.9,4415.8,4161.2,4170.4,4221.6],[8530.2,9516.3,13062.8,4081.4,4061.6,5070.8,4476.9],[8565.0,10152.2,11803.1,4053.3,4158.5,4243.4 ,4668.5],[8254.9,7864.0,12834.7,4084.6,4056.5,4008.8,4777.7],[9253.3,9157.8,13834.5,4129.4,4066.4,5101.5,4140.2],[7466.4,8046.8,14430.7,4017.2,4071.4,4127.8,4119.6 ],[7613.7,11320.6,15650.5,3799.7,4333.8,4034.8,5113.4],[8121.3,9085.4,14041.3,4294.0,4291.3,4022.0,4962.4],[6931.0,10507.2,5873.1,4133.0,4208.0,4087.4,4942.5], [8063.8,9542.1,4095.7,4093.1,4859.2,4083.4,4160.7],[7970.0,9523.3,4139.9,4299.5,4079.8,42 15.3,5010.8],[8514.4,8689.4,4473.0,4309.8,4247.4,3999.3,4079.3],[9819.5,9929.5,4019.5,4552.2,4148.7,3987.5,4098.5],[8863.0,9436.0,3938.8,4074.8,4975.4,4075.5, 4297.8],[8279.8,11751.5,3905.2,4077.0,4184.0,4874.9,4332.3],[8129.4,10037.2,3975.9,5397.7,4253.1,5249.5,4092.9],[11608.2,13561.8,4094.5,4101.9,4238.2,4237.9,4064.6] ,[8599.3,11393.1,4151.3,5142.4,4470.9,4157.3,4132.3],[9218.4,11990.8,4983.4,4458.6,4111.0,5278.0,4194.9],[8939.5,14791.0,4537.2,5199.8,4316.8,5117.4,4145.9],[ 9443.0,9211.2,5569.6,4373.4,4156.6,5147.2,4182.8],[10185.4,13006.2,4069.5,4206.3,4532.7,4638.8,4956.4],[9109.5,12312.3,4278.7,4359.8,4066.7,4070.1,4256.0]]}} '
有人知道解决方法吗?因为我想稍后将整个字符串与正则表达式进行比较。
类似
if(str ==〜/ ^ {\" [a-zA-Z0-9 _-] + \":[({\" name \":\ " [A-ZA-Z0-9 _-] + \" \,\ S \" baselineDays \":[[[([0-9] + [[ 0-9] +]?\,?\ s?)+] \,?\ s?] +]} \,?\ s?)+]} /){ println"匹配" } else { println" not match" }
谢谢,