Skip to content

Commit

Permalink
Fix RegExp for checking semanticId (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
seicke authored Sep 13, 2024
1 parent b110a1f commit 2d2eeac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aas-web-ui/src/mixins/SubmodelElementHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ export default defineComponent({
for (const key of submodelElement.semanticId.keys) {
if (key.value.startsWith('http://') || key.value.startsWith('https://')) {
// e.g. IDTA IRI like
if (new RegExp('/d/d/{0,1}' + '$').test(semanticId)) {
if (new RegExp(/\/\d\/\d\/{1}/).test(semanticId)) {
if (key.value === semanticId) return true;
} else {
if (key.value.startsWith(semanticId)) return true;
}
} else if (key.value.startsWith('0173-1')) {
// ECLASS IRDI like 0173-1#01-AHF578#001 resp. 0173-1-01-AHF578-001
if (new RegExp('[#-]{1}d{3}$').test(semanticId)) {
if (new RegExp(/[#-]{1}d{3}$/).test(semanticId)) {
// ECLASS IRDI with version (like 0173-1#01-AHF578#001 resp. 0173-1-01-AHF578-001)
if (key.value === semanticId) return true;
} else {
Expand Down

0 comments on commit 2d2eeac

Please sign in to comment.