Maybe something like

function mysplit(s)
  a = split(s, "string1")
  b = split(a[2], "string2")
  c = split(b[2], "string3")
  (b[1],c[1])
end

julia> s = "string1[10-15 characters]string2[string I need to 
extract]string3"
julia> mysplit(s)
("[10-15 characters]","[string I need to extract]")

HTH,

Tamas

On Wednesday, March 4, 2015 at 5:58:41 PM UTC+1, Nils Gudat wrote:
>
> I'm trying to do some web scraping in Julia and have downloaded a web page 
> as a UTF8String via Requests.jl. Now I need to extract some data from this, 
> but unfortunately the structure of the page is a bit messy, and it seems 
> the only way to get what I need is to extract a substring between two other 
> substrings. The structure would look something like
>
> "string1"[10-15 characters]"string2"[string I need to extract]"string3"
>
> Do I need to use regular expressions for this or is there an easier option 
> in Julia to match these sorts of more complex string patterns?
>
> Thanks!
>

Reply via email to