asp.net - How to fetch only number from the string using between value? -


i have string in want show 1568.41 using regex how can that
string

`*pqs«
price quote record - summary name number

              retained fare                                   name    pq type tkt des              created       tkt ttl        1.1     1                            14may usd   1568.41         2.1     1                            14may usd   1568.41         3.1     2  cnn ch25                  14may usd   1363.41 ` 
  • i used 1.1\s{2,5}\d\s(.+) regex fetch complete line.
  • i used (?<=usd)\s{2,5}\d{1,4}.\d{2}(?=\s(.+)) didn't work

there string in same want fetch number

wpncb«                                                          19aug departure date-----last day purchase 21may/2359                 base fare      equiv amt      taxes             total      1-       dkk790       usd139.00     179.40xt       usd318.40adt      xt    109.80yq      19.20yr      29.00zo         5.40ua                   2.00ud       14.00yk                                              790         139.00     179.40            318.40ttl 

and in below need first number

tqt t     p/s  name                   total            fop                 segments  9    .3  tmacdorman/sam corbin    usd      1177.17 check                  4-5    10   .1  tloj/danuta isabella     usd      1341.17 check                  4-5    10  .2  tmacdorman/jack henry    usd      1341.17 check                  4-5 

in above string need

  • 9
  • 10
  • 10

in string want fetch 318.40 before ttl when use regex include ttl , when use between regex in can't work regex in \d{1,4}\.\d{2}ttl

thanks in advance

to capture second question in request. note did change white space search boarder search little bit cleaner.

this regex here requires the string followed ttl

(?:\b)([0-9]{0,}[.][0-9]{2})(?=ttl)

enter image description here

enter image description here


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -