Regular Expression Help

Associate
Joined
2 Sep 2007
Posts
2,001
Hi All

I need to pull out the long value between the " " any ideas for a regular expression. Cheers.

<INPUT name=epdqdata type=hidden value="3F3CCB89A399D038C952439C788A9DACB04721DEF8D4AFAAE6E4F96FEB5AFB4DA6C8C196EAF895548EC6861C64166DB693A0569E6AFA1430A12944D9F035C6FD7CBE912F017E18A7DDDFE136CB9817FA8E2C61496A8C59A7">
 
If it's always gonna be done with attributes in X/HTML, you might as well use DOM's getElementsByTagName()[].attributes.getNamedItem().value, much less work.
 
Language? Regular expressions library?

Code:
/value="([A-F0-9]+)"/

...should do it.

Unless those spaces and newlines are in the source too, in which case

Code:
/value="([A-F0-9 \r\n]+)"/

might be handier (assuming CR and LF are represented by \r and \n, note)
 
Back
Top Bottom