Community Patterns

1

ตรวจสอบพยัญชนะต้นตัวสะกดสระและวรรณยุกต์ไทย

Created·2026-01-22 01:36
Updated·2026-01-23 12:42
Flavor·ECMAScript (JavaScript)
ตรวจสอบพยัญชนะต้น (ต้องมี) ตรวจตัวสะกดสำหรับสระที่ต้องมี ตรวจสอบการวางสระและวรรณยุกต์ไทย หมายเหตุ การตรวจสอบตัวสะกดในภาษาไทยตรวจสอบได้ยากเพราะภาษาไทยเป็นภาษาที่เขียนติด ๆ กันไม่มีการแบ่งคำอย่างชัดเจนทำให้การอ่านภาษาไทยผู้อ่านต้องใช้ความหมายของคำในการตัดสินการอ่านแบ่งคำตามความเหมาะสมเช่นคำว่า "ตากลม" อาจอ่านเป็น "ตาก-ลม" ก็ได้ หรืออ่านเป็น "ตา-กลม"ก็ได้ ดังนั้นการเขียน Regex เพื่อทำการตรวจสอบอาจช่วยได้ระดับหนึ่ง อ่าจมีผิดบ้างถูกบ้าง แต่ก็ถือว่าเป็นเครื่องมือที่ใช้ช่วยเหลือในการตรวจสอบเพิ่มเติมได้ 80% ของความเป็นไปใด้ก็แล้วกันนะครับ หวังว่าการเขียนเพิ่มเติมส่วนนี้ จะมีประโยชน์บ้างไม่มากก็น้อย
Submitted by อธิปัตย์ ล้อวงศ์งาม
1

gamgamtest_matei_überwiegend_version2

Created·2025-11-21 07:37
Flavor·PCRE2 (PHP)
Tier Verwalter setName($name); $this->setAlter($alter); $this->setGewicht($gewicht); $this->setGeburtsdatum($geburtsdatum); $this->setArt($art); $this->id = uniqid(); } // Getter und Setter für name public function setName($name) { $this->name = $name; } public function getName() { return $this->name; } // Getter und Setter für alter public function setAlter($alter) { $this->alter = $alter; } public function getAlter() { return $this->alter; } // Getter und Setter für gewicht public function setGewicht($gewicht) { $this->gewicht = $gewicht; } public function getGewicht() { return $this->gewicht; } // Getter und Setter für geburtsdatum public function setGeburtsdatum($geburtsdatum) { $this->geburtsdatum = $geburtsdatum; } public function getGeburtsdatum() { return $this->geburtsdatum; } // Getter und Setter für art public function setArt($art) { $this->art = $art; } public function getArt() { return $this->art; } public function getId() { return $this->id; } } if (isset($_POST'speichern'])) { $neuesTier = new Tier( $_POST['name'], $_POST['alter'], $_POST['gewicht'], $_POST['geburtsdatum'], $_POST['art'] ); if (!isset($_SESSION['tiere'])) { $_SESSION['tiere'] = array(); } $_SESSION['tiere'] = $neuesTier; } if (isset($_POST['loeschen'])) { if (isset($_SESSION['tiere'])) { unset($_SESSION['tiere']); $_SESSION['tiere'] = array(); } } ?> Neues Tier hinzufügen Name: Alter: Gewicht (kg): Geburtsdatum: Art: Speichern Alle löschen Gespeicherte Tiere: 0) { foreach ($_SESSION['tiere'] as $tier) { echo "Tier: " . htmlspecialchars($tier->getName()) . ""; } } else { echo "Keine Tiere gespeichert."; } ?>
Submitted by anonymous

Community Library Entry

12

Regular Expression
Created·2015-03-12 09:23
Flavor·Python

r"
(^https?://)?(\w+)?\.?(reddit\.com/|redd\.it/)(r/\w+/)?(comments/)?(\w+)
"
gm
Open regex in editor

Description

Simply searches for the thread-id in any kind of valid reddit-URL.

Submitted by Mio