gchaudhari wrote:
sebb-2-2 wrote:
On 18/03/2008, gchaudhari <[EMAIL PROTECTED]> wrote:
Hi,
Can anybody please help me generate a regular expression for a ViewState
value which is dynamically generated.
An example of viewstate value is as follows:
rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAVfaWQ0NXB0ABsvcGFnZXMvcHJvdGVjdGVkL21haW4ueGh0bWw=
More information is needed, otherwise the RE may match other items.
For example:
.+
would match, but it will match almost anything.
\w+=
would work, but again it may match too much.
Is the value always the same length? Or does it vary, if so what are
the upper and lower bounds.?
The value is 112 characters.
Is it always alphanumeric, or can it contain other characters?
Yes, it is always alphanumeric
Is the "=" part of the value?
The '=' may/may not be a part of the viewstate value.
What is the context in which it appears, i.e. what immediately
surrounds the value?
Can the surrounding text appear anywhere else, or is it unique?
The surrounding is as follows -
<input type="hidden" name="javax.faces.ViewState"
id="javax.faces.ViewState"
value="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAZfaWQxMDVwdAAbL3BhZ2VzL3Byb3RlY3RlZC9tYWluLnhodG1s"
/></form>
</div>
So try a Regex like:
<input\s+type="hidden"\s+name="javax.faces.ViewState"\s+id="javax.faces.ViewState"\s+value="([^"]+)"
Then set your template to $1$
# r
--
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
[EMAIL PROTECTED]
www.groupbc.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]