I want to match a regex of the following form
(hex_number) (anything) constant=(true or开发者_如何学C false)
anything
can match any printable character or a space or tab. I am programming in java so I was using the following regex:
(\\p{Alnum}+) (\\.+) constant=(true|false)
The first two matching groups is what I really want. I however do not get a match.
Any ideas?
PS: Alnum
and .
are just for simplicity and it is fine that they will match more than what I require.
Edit: Can't believe I missed this the first time. You want .
, not \\.
. Your version matches a literal .
character.
([0-9A-Fa-f]+)\\s(.+)\\sconstant=(true|false)
精彩评论