I'm currently working on creating a regex in Selenium IDE to extract a 4-digit number from an input text that has been stored using the storeValue
command. An example of the string that is stored is:
'undergraduate 2016 computer science'
. When successfully extracting the 4-digit number, the result should be 2016
, then reassigned and stored as a variable named year
. Here is my attempt at achieving this:
storeValue | xpath=/html/body/form/div[4]/div/div/section/div[1]/div/input[1] | year
storeEval | storedVars['year'].match(/\\d{4}/)[0]; | year
However, upon running the code, I encountered the error message:
[error] Threw an exception: missing ; before statement
. Does anyone have suggestions on how this issue can be resolved? Thank you in advance.