TECH Regular Expression Help

fishbulb

Well-Known Member
Oct 29, 2001
7,112
Trying to get a reg exp. working to match a specific word, then any number of any characters, then a specific closing character, pattern like this:
[sku-price:*] where the asterisk can be any data, including dashes (-)
Tried this based on what I'm reading from tutorials, but it isn't working:
Code:
preg_match("[\[sku-price:.*$\]]",$string,$matches);
Thanks
 
Last edited:
TS
TS
fishbulb

fishbulb

Well-Known Member
Oct 29, 2001
7,112
Got it working with
Code:
preg_match_all("/\[sku-price:.*?\]/",$string,$matches);
Not sure if this is the most efficient method but it will work for now.
 

Users who are viewing this thread

About Us

  • Please do not post anything that violates any Local, State, Federal or International Laws. Your privacy is protected. You have the right to be forgotten. Site funded by advertising, link monetization and member support.
OT v15.8.1 Copyright © 2000-2022 Offtopic.com
Served by fu.offtopic.com

Online statistics

Members online
467
Guests online
62
Total visitors
529

Forum statistics

Threads
369,463
Messages
16,885,624
Members
86,873
Latest member
vitalesan