0

I want to catch the value of some HTML tag. that could look like this:

value='3242312-3245-3245,234:3245:324,asdf asdf,asdf asd'>

or like this:

value=358 >

and maybe this:

value=83 selected='selected'>

I tried:

Pattern.compile("value=[[\'(.+)\'][(0-9)\\s]]")

but with no success...

any idea what pattern should I use?

user1557330
  • 129
  • 1
  • 1
  • 9

1 Answers1

0

This expression should work:

(?<field>\w+)=(('(?<value>[^']*)')|(?<value>\S+))

You can test here using the same expression w/o group names (since the tool doesn't support them):

(\w+)=(('([^']*)')|(\S+))
Tyson
  • 1,685
  • 15
  • 36