From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../global_objects/regexp/flags/index.html | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 files/de/web/javascript/reference/global_objects/regexp/flags/index.html (limited to 'files/de/web/javascript/reference/global_objects/regexp/flags') diff --git a/files/de/web/javascript/reference/global_objects/regexp/flags/index.html b/files/de/web/javascript/reference/global_objects/regexp/flags/index.html new file mode 100644 index 0000000000..65956f3c3b --- /dev/null +++ b/files/de/web/javascript/reference/global_objects/regexp/flags/index.html @@ -0,0 +1,83 @@ +--- +title: RegExp.prototype.flags +slug: Web/JavaScript/Reference/Global_Objects/RegExp/flags +tags: + - ECMAScript 2015 + - Eigenschaft + - JavaScript + - Prototyp + - Referenz + - RegExp + - Regular Expressions + - Reguläre Expressionen +translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/flags +--- +
{{JSRef}}
+ +

Die flags Eigenschaft gibt einen String mit den Flags des RegExp-Objektes zurück.

+ +
{{EmbedInteractiveExample("pages/js/regexp-prototype-flags.html")}}
+ + + +
{{js_property_attributes(0, 0, 1)}}
+ +

Beschreibung

+ +

Flags in der flags Eigenschaft sind alphabetisch sortiert (von links nach rechts, z.B. "gimuy").

+ +

Beispiele

+ +

Die flags benutzen

+ +
/foo/ig.flags;   // "gi"
+/bar/myu.flags;  // "muy"
+
+ +

Polyfill

+ +
if (RegExp.prototype.flags === undefined) {
+  Object.defineProperty(RegExp.prototype, 'flags', {
+    configurable: true,
+    get: function() {
+      return this.toString().match(/[gimuy]*$/)[0];
+    }
+  });
+}
+
+ +

Spezifikationen

+ + + + + + + + + + + + + + + + + + + +
SpezifikationStatusKommentar
{{SpecName('ES2015', '#sec-get-regexp.prototype.flags', 'RegExp.prototype.flags')}}{{Spec2('ES2015')}}Initielle Definition.
{{SpecName('ESDraft', '#sec-get-regexp.prototype.flags', 'RegExp.prototype.flags')}}{{Spec2('ESDraft')}} 
+ +

Browser-Kompatiblität

+ +
+ + +

 {{Compat("javascript.builtins.RegExp.flags")}}

+
+ +

Siehe auch

+ + -- cgit v1.2.3-54-g00ecf