Skip to content

Commit

Permalink
Remove dependency to stdlib regex
Browse files Browse the repository at this point in the history
sysdig-CLA-1.0-contributing-entity: SAP SE
sysdig-CLA-1.0-signed-off-by: David Ansari <[email protected]>
  • Loading branch information
ansd committed May 13, 2019
1 parent 850c55e commit 4b1717d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions userspace/libsinsp/container_engine/bpm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

#include <regex>

#include "container_engine/bpm.h"
#include "sinsp.h"

Expand Down Expand Up @@ -46,8 +43,7 @@ bool bpm::resolve(sinsp_container_manager* manager, sinsp_threadinfo* tinfo, boo

// As of BPM v1.0.3, the container ID is only allowed to contain the following chars
// see https://github.com/cloudfoundry-incubator/bpm-release/blob/v1.0.3/src/bpm/jobid/encoding.go
regex re("[a-zA-Z0-9._-]+");
if (regex_match(id, re))
if (!id.empty() && strspn(id.c_str(), "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-") == id.size())
{
container_info.m_type = CT_BPM;
container_info.m_id = id;
Expand Down

0 comments on commit 4b1717d

Please sign in to comment.