Well, for what you describe, regular expression seems to be the best
way to go.
As I said, it seems rather difficult at the first look but when you
know how to use it, you will really appreciate its power.
In Javascript, it's look like this :
As an example, you have a page where the title is "carte de la
galaxie" or "carte de Fuuren" or "carte de Baten Kalaa"
and you want to capture what is after "carte de ..."
var regularExpression = new RegExp("de\\s(\\w+?\\s?\\w+)$");
var parseString = regularExpression.exec(titleText);
if something is found, parseString will be an array with
parseString[0] containing the whole string and parseString[1] the name
found (what is inside the parenthesis)
But to be honest, it's more a problem of Javascript than a problem
with Grease Monkey, an I'm not sure that this mailing list is the best
place to discuss about.
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" 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/greasemonkey-users?hl=en.