check that we have an exact match (whole string)

This commit is contained in:
Laurent Rineau 2023-08-24 16:47:40 +02:00
parent d8583c93d5
commit dc7f6af55d
1 changed files with 4 additions and 4 deletions

View File

@ -329,13 +329,13 @@ void Scene_plane_item::setPlaneOrientation()
if(!ok) if(!ok)
return; return;
match = rx.match(eq); // AF: exact? match = rx.match(eq);
// does_match = rx.exactMatch(eq); does_match = match.hasMatch() && match.capturedLength(0) == eq.size();
if(! match.hasMatch()) if(!does_match)
{ {
QMessageBox::warning(CGAL::Three::Three::mainWindow(),"Error","The input must be of the form a*x+b*y+c*z+d=0"); QMessageBox::warning(CGAL::Three::Three::mainWindow(),"Error","The input must be of the form a*x+b*y+c*z+d=0");
} }
}while(! match.hasMatch()); }while(!does_match);
double a(match.captured(1).toDouble()), b(match.captured(2).toDouble()), c(match.captured(3).toDouble()), d(match.captured(4).toDouble()); double a(match.captured(1).toDouble()), b(match.captured(2).toDouble()), c(match.captured(3).toDouble()), d(match.captured(4).toDouble());
Kernel_epic::Point_3 sure_point(0,0,0); Kernel_epic::Point_3 sure_point(0,0,0);