Ämne: Regexp
Visa ett inlägg
Oläst 2006-05-17, 10:40 #1
Innocast Innocast är inte uppkopplad
Mycket flitig postare
 
Reg.datum: Aug 2004
Inlägg: 688
Innocast Innocast är inte uppkopplad
Mycket flitig postare
 
Reg.datum: Aug 2004
Inlägg: 688
Kod:
<?php
	$string = "HEJSAN DETTA ÄR #ETT# ORD OCH NU SKA VI TA FRAM ALLA #SAKER# SOM STÅR MELLAN STAKETEN!";
	$pattern = '/(\#)*(\#)/i';
	preg_match($pattern, $string, $matches);
	print_r($matches);
?>
Vill hämta ut följande ord:

ETT
SAKER

Men kan inte få min regexp o fungera, sitter nu o söker o letar hur man använder det. Aldrig skrivit regexp själv och behöver lite tips
Innocast är inte uppkopplad   Svara med citatSvara med citat