xml - getting a substring out of a item in yahoo pipes -


following situation:

item.    content => "this 48593 test"    title => "the title"  item.    content => "this 48593 test 3255252"    title => "the title"  item.    content => "this 35542 48593 test"    title => "the title"  item.    content => "i havent 5 digits 34567654"    title => "the title" 

this current item in console of pipes

no want replace "content" "the last match of number has 5 digits. wanted result:

item.    content => "48593"    title => "the title"  item.    content => "48593"    title => "the title"  item.    content => "48593"    title => "the title"  item.    content => ""    title => "the title" 

is there way in pypes 2?

please comment if unclear

use regex module this:

in item.content replace (.*) x $1

in item.content replace .*\b(\d{5})\b.* $1

in item.content replace x .* nothing (leave field empty)

here's example pipe

some explanations

  • \d{5} finds 5 digits
  • \b word boundaries, numbers more digits not found
  • the x @ beginning marks strings regular expression doesn't match delete them afterwards
  • finding last number , not first default behavior. because * greedy operator.

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -