Jump to content


Photo

help: get data from string


  • Please log in to reply
2 replies to this topic

#1 duall

duall
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 September 2006 - 03:18 PM

hi,

i have some long strings like

{{{[adena];3504;7154;100}};70};{{{[soul_separator];1;1;0.2693};{[soul_separator_head];1;1;99.7307}};0.3539};{{{[crafted_leather];1;1;4.7683};{[mold_glue];1;1;4.5299};{[mold_hardener];1;1;1.1817};{[thons];1;1;4.5299};{[scrl_of_ench_am_s];1;1;0.0544};{[mithril_arrow];20;60;84.9358}};31.5556}


i want to select one line from the string like:

{{{[soul_separator];1;1;0.2693};{[soul_separator_head];1;1;99.7307}};0.3539}


Which starts with {{{[   
And ends with  }};anyNumber}

PS: the line should be selected by a keyword like: [soul_seperator] or [soul_separator_head] or [anyword]


#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 19 September 2006 - 03:40 PM

You'd be wise to use a regular expression here.

Have a look at the RegEx section in the manual.

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 duall

duall
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 September 2006 - 07:17 PM

any ideas a script or sth..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users