Anybody out there good with Regular Expressions / REGEX?

Venture

Administrator
Staff member
Founder
Joined
Feb 26, 2010
Messages
2,053
Likes
13
#1
Joined
Jun 25, 2012
Messages
71
Likes
1
Location
Denver, CO - USA
#2
My experience with REGEX is in Python, PERL, and grep (bash). In Python and PERL use I typically create a regex to perform the match and "capture" a specific portion of the string (like "300" in your example), then create the replacement string using the captured string concatenated with whatever new string.
Based on your example, I would capture the topic value using regex:
/topic=(\d+)\.
Then create new string using "http://www.yamahasupertenere.com/index.php?threads/" + $capturestring + "/"
How you perform the concatenation will be dependent on the forum software.

I like regex101.com for testing regular expressions as it gives a great explanation how it's decoding the string and applying the regex match. Click here for an example I created.
 
Last edited:
Top Bottom