RegEx: Capture only the interior of the capture group -
In the following string, I only match 10.00
test (+ $ 15.00) Want to (DSFA) (+ $ 10.00)
I have now:
\ ([\ + | \ -] \ $ (?: [0 - 9 +.] +?) \ $$
But this is capture (+ $ 10.00), I want to be the only internal of the capture group.
Edit Do: I'm using JS
The problem is that you did not define your capturing group Pattern, you have only virtual brackets that are completely different, it will give you results in capturing group 1 . That is defined with simple brackets (...)
:
\ ([+ -] \ $ ([0-9. ] +) \) $
(Note that many letters are not required to be avoided, especially all special characters are seen in a character class as literal .)
In the preview pattern, I want to use a capturing group that I want to get from the whole result.
(? & Lt ; = \ ([+ -] \ $) [0] It is possible to see that you Want to see results as a whole result (with regex engine) -9.] + (? = \) $)
Comments
Post a Comment