Hello

I am trying to write a regular expression to match a embedded image
within a tiddler.  For example given

  var inputString = "Preceeding text. [img[tooltip|http://www.nasa.gov/
office/pao/History/alsj/a13/ap13-70-HC-291.jpg]] Following text."

what i want to first is to match the sub string that begins with "[img
[" and ends with "jpg]]"

What almost works so far is
  var regExp5 = /[\]]*img\[[^\]]+[\]]+/;
  var match5 = regExp5.exec(inputString);

It matches everything except the first "[" In other words match5
is "img[tooltip|http://www.nasa.gov/office/pao/History/alsj/a13/
ap13-70-HC-291.jpg]]"

Three questions about the regular expression:
* how to match the first "["
* where to insert the parenthesis to capture the optional tooltip
* where to insert the parenthesis to capture the image link that
begins with "http" and ends with "jpg"

Thanks for any help
Steve W

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to