-2

I would like to capture the British pound sign and any numbers over 4.

Examples of what i would like to match:

£30,000
£10,000
£100,000
£10000
£12,450
£1000000

Examples of what i don't want to match:

£100
100
£1000
£1000.00
£5000
£2.20
£1
£0
anubhava
  • 761,203
  • 64
  • 569
  • 643
Mannie Singh
  • 119
  • 3
  • 17

1 Answers1

2

You can use this regex:

£(?=(?:\d,?){5})[\d,.]+

RegEx Demo

anubhava
  • 761,203
  • 64
  • 569
  • 643
  • `1,000.00` is not valid, though. (`1,000` is 5 in length) – h2ooooooo Sep 19 '14 at 10:47
  • Strange that title says length should be 4. More clarity needed from OP I think. – anubhava Sep 19 '14 at 10:50
  • Yeah, I agree, but from his examples I suppose he wants numbers that are `10000` or higher. OP needs to respond, though. – h2ooooooo Sep 19 '14 at 10:51
  • This also matches characters can it only be set to match numbers. Example £100,000blablah – Mannie Singh Sep 19 '14 at 10:57
  • thanks but one thing it should still match text text £100,000 text text > it should still match £100,000 and even when its £100,000blahblah > should still match £100,000 but not the text. – Mannie Singh Sep 19 '14 at 11:03
  • 1
    Not clear what you want. Doesn't it totally match what you said valid and invalid list in the question? If your requirement is different then why not update the question and make it clear. – anubhava Sep 19 '14 at 11:05
  • I have made another update based on my understanding. See if this works for you (check new demo also). – anubhava Sep 19 '14 at 11:09