Digital and social media need to be mandatorily regulated in the country to preserve the rule of law under the Constitution, Supreme Court Judge Justice J B Pardiwala said on Sunday, terming as “dangerous” the crossing of ‘Lakshman rekha’ on these platforms for “personalised, agenda-driven attacks" on the judges.