Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wieder ein Regexp

Empfohlene Antworten

Veröffentlicht

Hallo ich hab ne frage ... ich hab einen fetten String ... innerhalb des Strings steht igrnedwann mal Reorder%3E%3COption%3E1 das drin.

Ich muss rausfinden ob am Schluss des Strings eine 0 oder ein 1er steht .

kann ich das via Regexp herrausfinden?

Wär cool wenn mir jemand helfen könnte :)

Danke mcmaiers

Reorder%3E%3COption%3E1


Reorder%3E%3COption%3E(\d)

$1 ist deine Zahl.

EDIT:

Wenn der erste Teil des Strings aber fest ist, wäre es wohl performanter, einfach ganz normal das Vorkommen dieses Strings zu suchen und dann einfach von dieser Position + Länge dieses Teils das nächste Zeichen zu prüfen.

in php etwa so:


$pos = strpos("Reorder%3E%3COption%3E", $string);
$pos = $pos + strlen("Reorder%3E%3COption%3E") + 1;
$result = ($string[$pos] == "1");
[/php]

Warum so kompliziert?

innerhalb des Strings steht igrnedwann mal Reorder%3E%3COption%3E1 das drin.

Weil das nicht der komplette String ist ;)

Danke euch beiden !!!

Das ist natürlich der einfacher Weg ... unbd das coolse ist , er funktionier einwandfrei! Danke:)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.