Problem

Regular expression works in regexpal.com tool but doesn't validate in the regex plugin (Screenshot attached).

Maybe i'm doing something wrong? I've tried the regular expression with and without forward slash format like:

Regular Expression

/(\s-\s)[a-z/\s]*\1[^\s][smlx]*/
(\s-\s)[a-z/\s]*\1[^\s][smlx]*

Example text

Men's Long-Sleeve Raglan Baseball Jersey - ATHLETIC HTHR/BLACK - 2XL
Men's 4 oz. Double Dry Performance T-Shirt - BLACK - 2XL
Men's 4.1 oz. Short-Sleeve Performance T-Shirt - BLACK - 2XL

Desired output

Men's Long-Sleeve Raglan Baseball Jersey
Men's 4 oz. Double Dry Performance T-Shirt
Men's 4.1 oz. Short-Sleeve Performance T-Shirt

I've also tried the trim plugin several times and gave up on that as well.

CommentFileSizeAuthor
regex-feeds-tamper.png176.25 KBchrisjlee

Comments

CGarces’s picture

Same error with
/<font\b[^>]*>(.*?)</font>/

I'm using 7.x-1.0-beta3

twistor’s picture

#1 In the error in the image, you are missing the prefix and suffix /your regex here/.

#2, you need to escape the / in </front>, or use a different prefix and suffix: |<font\b[^>]*>(.*?)</font>|

twistor’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.