trouble in getting pattern with regex

Hello , I have string like that " McKinley|alt=Denali|peak=is the highest point of the [[Alaska Range]], the [[State of Alaska]], the [[United States of America]], and all of [[North America]]|pb=271|date=February 27, 2010}} |{{flag|Alaska}} {{cmtr|Alaska Range}} {{epi|6193.536|6149.000|7450.24|m=2}} |{{coord|63.0690|-151.0063|name=Mount McKinley}} "
and I want to get some part of it into arrays and store them in files. But I could not get [[United States of America]] , [[State of Alaska]] , [[North America]] values by using regex .
preg_match("/[^[a-zA-Z+]$]/", “PHP is the web [[scripting]] language of choice.”,$deger)
or with eregi
they didnt give result that I want. I want to get values inside [[ ]] .
Do you have any idea , help please ?

Well, if all of your data is exactly like your sample, just REMOVE them before putting the data thru your regex… Just do a string replace for “[”, “” and “]”, “” … Then, do the other string parsing…

yeah it can another way friend
thank you

Do you mean it is solved, or do you need further help pulling out the [[]] data?
(Wasn’t sure which you meant.)

now I am trying it on java, but as you offer I will try to replace first php
then will use preg_match.
I am still working on it
thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service