Hello!
Thank you very much for your post!
I use your regex in python, but it doesn't work well.
It work for this :
sun.util.calendar.ZoneInfo[id="Europe/Zurich",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=119,lastRule=java.util.SimpleTimeZone[id=Europe/Zurich,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]
But not for that : java
public void testMonthDayPlusDaysWrapsMonthCorrectly() {
MonthDay d = new MonthDay(5,15);
assertEquals(d.plusDays(25).plusDays(25), d.plusDays(50));
}
For exemple :
import re
string_1 = """
sun.util.calendar.ZoneInfo[id="Europe/Zurich",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=119,lastRule=java.util.SimpleTimeZone[id=Europe/Zurich,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]"""
string_2 = """java
public void testMonthDayPlusDaysWrapsMonthCorrectly() {
MonthDay d = new MonthDay(5,15);
assertEquals(d.plusDays(25).plusDays(25), d.plusDays(50));
}"""
Hello!
Thank you very much for your post!
I use your regex in python, but it doesn't work well.
It work for this :
sun.util.calendar.ZoneInfo[id="Europe/Zurich",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=119,lastRule=java.util.SimpleTimeZone[id=Europe/Zurich,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]
But not for that :
java public void testMonthDayPlusDaysWrapsMonthCorrectly() { MonthDay d = new MonthDay(5,15); assertEquals(d.plusDays(25).plusDays(25), d.plusDays(50)); }
For exemple :
import re
string_1 = """
sun.util.calendar.ZoneInfo[id="Europe/Zurich",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=119,lastRule=java.util.SimpleTimeZone[id=Europe/Zurich,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]
"""string_2 = """
java public void testMonthDayPlusDaysWrapsMonthCorrectly() { MonthDay d = new MonthDay(5,15); assertEquals(d.plusDays(25).plusDays(25), d.plusDays(50)); }
"""markdown1 = re.findall(r'(
[a-z]*\n[\s\S]*?\n
)', string1)markdown2 = re.findall(r'(
[a-z]*\n[\s\S]*?\n
)', string2)print(markdown1)
print(markdown2)