Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression

/
/
g

Test String

Substitution

Processing...

Code Generator

Generated Code

re = /\"|(.+)*\s*(\d*\.\d*)\s(\-\d*\.\d*)\s(\-\d*\.\d*)\s(\d*\.\d*)\s(\d*\.\d*)\s(\d*\.\d*)/ str = '"NewIndiaAssurance 160.95 -26.75 -14.25 4571.17 158.00 182.75 Central Bank Ind 19.45 -2.15 -9.95 59695.86 19.45 20.45 IOB 16.00 -1.60 -9.09 34491.11 15.85 17.40 Bank of Maha 21.35 -2.00 -8.57 16944.45 21.25 23.50 General Ins Corp 188.20 -16.85 -8.22 6521.16 186.55 224.00 Max Healthcare 191.70 -15.05 -7.28 759.06 191.65 210.85 Carborundum Uni 511.30 -36.20 -6.61 176.87 505.60 550.00 Bajaj Elec. 936.50 -61.85 -6.20 266.98 930.15 999.00 PVR 1386.00 -90.75 -6.15 1513.15 1382.15 1458.40 CAMS 1715.00 -107.00 -5.87 147.67 1712.55 1821.00 NHPC 24.50 -1.35 -5.22 4026.68 24.45 24.85 M&M 841.25 -38.00 -4.32 2687.16 840.00 882.50 ITC 207.10 -8.85 -4.10 28581.56 206.30 212.00 MahindraCIE 182.65 -7.60 -3.99 563.98 182.40 194.95 Rossari Biotech 997.00 -41.45 -3.99 372.34 990.05 1094.85 CenturyPly 305.50 -11.70 -3.69 86.33 305.00 319.70 Equitas Small Fin 46.35 -1.75 -3.64 659.14 46.00 48.95 L&T Tech 2550.00 -93.05 -3.52 61.31 2540.50 2649.40 Bosch 15038.75 -542.70 -3.48 35.59 14870.00 15639.85 UCO Bank 13.90 -0.50 -3.47 11886.34 13.40 14.65 Spicejet 83.30 -2.95 -3.42 1713.51 83.00 86.25 Kalpataru Power 367.10 -12.80 -3.37 152.64 365.00 381.40 Birlasoft 230.30 -7.95 -3.34 595.27 225.80 239.95 Prestige Estate 288.00 -9.55 -3.21 170.98 286.95 301.30 Escorts 1293.50 -42.45 -3.18 397.27 1290.00 1339.95" "NewIndiaAssurance 160.95 -26.75 -14.25 4571.17 158.00 182.75" "Central Bank Ind 19.45 -2.15 -9.95 59695.86 19.45 20.45" "IOB 16.00 -1.60 -9.09 34491.11 15.85 17.40" "Bank of Maha 21.35 -2.00 -8.57 16944.45 21.25 23.50" "General Ins Corp 188.20 -16.85 -8.22 6521.16 186.55 224.00" "Max Healthcare 191.70 -15.05 -7.28 759.06 191.65 210.85" "Carborundum Uni 511.30 -36.20 -6.61 176.87 505.60 550.00" "Bajaj Elec. 936.50 -61.85 -6.20 266.98 930.15 999.00" "PVR 1386.00 -90.75 -6.15 1513.15 1382.15 1458.40" "CAMS 1715.00 -107.00 -5.87 147.67 1712.55 1821.00" "NHPC 24.50 -1.35 -5.22 4026.68 24.45 24.85" "M&M 841.25 -38.00 -4.32 2687.16 840.00 882.50" "ITC 207.10 -8.85 -4.10 28581.56 206.30 212.00" "MahindraCIE 182.65 -7.60 -3.99 563.98 182.40 194.95" "Rossari Biotech 997.00 -41.45 -3.99 372.34 990.05 1094.85" "CenturyPly 305.50 -11.70 -3.69 86.33 305.00 319.70" "Equitas Small Fin 46.35 -1.75 -3.64 659.14 46.00 48.95" "L&T Tech 2550.00 -93.05 -3.52 61.31 2540.50 2649.40" "Bosch 15038.75 -542.70 -3.48 35.59 14870.00 15639.85" "UCO Bank 13.90 -0.50 -3.47 11886.34 13.40 14.65" "Spicejet 83.30 -2.95 -3.42 1713.51 83.00 86.25" "Kalpataru Power 367.10 -12.80 -3.37 152.64 365.00 381.40" "Birlasoft 230.30 -7.95 -3.34 595.27 225.80 239.95" "Prestige Estate 288.00 -9.55 -3.21 170.98 286.95 301.30" "Escorts 1293.50 -42.45 -3.18 397.27 1290.00 1339.95" Loading   "Indian Hotels 119.90 -3.90 -3.15 2264.66 119.55 123.80" "Escorts 1293.95 -42.00 -3.14 397.75 1290.00 1339.95" "Axis Bank 726.20 -23.45 -3.13 7967.93 724.20 749.85" "Route Mobile 1802.70 -57.45 -3.09 263.50 1794.00 1883.20" "Larsen & Toubro 1462.40 -46.40 -3.08 3532.42 1447.10 1511.95" "TVS Motor 587.60 -18.65 -3.08 1477.20 581.55 609.80" "SKF India 2280.90 -72.10 -3.06 17.37 2247.80 2369.90" "Syngene Int. 562.60 -17.40 -3.00 202.06 562.25 581.80" "KNR Construct 206.85 -6.40 -3.00 339.00 205.20 216.00" "Bharat Forge 585.15 -17.85 -2.96 2217.53 583.60 607.70" "REC 141.40 -4.30 -2.95 4006.92 140.75 145.60" "IGL 527.00 -15.95 -2.94 1586.37 525.10 545.00" "Eicher Motors 2510.40 -74.25 -2.87 831.53 2506.30 2590.00" "Tech Mahindra 965.60 -28.35 -2.85 2629.52 961.65 1011.00" "Maruti Suzuki 7115.50 -207.50 -2.83 805.75 7096.00 7325.00" "TTK Prestige 7100.00 -203.05 -2.78 2.95 7015.50 7289.95" "Ibull HousingFin 222.60 -6.30 -2.75 9745.13 222.25 231.75" "IIFL Wealth Mgmt 1167.70 -32.80 -2.73 31.70 1161.10 1215.45" "Natco Pharma 792.50 -22.20 -2.72 219.41 790.20 825.95" "Ujjivan SFB 34.15 -0.95 -2.71 1740.96 34.05 35.25" "IDBI Bank 30.55 -0.85 -2.71 6393.93 30.40 31.70" "Tata Elxsi 2666.65 -73.95 -2.70 166.13 2662.00 2740.60" "VST Industries 3529.90 -97.15 -2.68 7.91 3505.00 3627.10" "Garware Tech 2382.75 -65.25 -2.67 4.72 2379.10 2498.85" "Bank of India 82.05 -2.25 -2.67 20298.66 77.60 86.45" "BEL 131.80 -3.60 -2.66 4210.18 131.65 136.55" "HUDCO 43.95 -1.20 -2.66 1237.24 43.80 45.40" "L&T Fin Holding 97.20 -2.65 -2.65 9354.49 96.85 100.85" "SBI Life 858.75 -22.75 -2.58 752.30 858.40 885.00" "HDFC 2671.25 -70.05 -2.56 1891.41 2670.00 2741.30" "GSPL 242.35 -6.35 -2.55 285.69 242.20 251.00" "HDFC Life 692.80 -17.85 -2.51 1548.17 690.30 713.65" "Coal India Ltd 135.75 -3.50 -2.51 9325.43 135.25 139.40" "PNC Infratech 255.95 -6.55 -2.50 257.57 245.00 265.00" "Endurance Tech 1360.90 -34.55 -2.48 104.87 1351.50 1414.00" "LIC Housing Fin 438.15 -11.15 -2.48 2700.62 437.00 452.75" "Federal Bank 81.40 -2.05 -2.46 9963.61 81.30 84.15" "TCS 2996.15 -75.70 -2.46 2192.08 2995.45 3096.00" "NBCC 36.75 -0.90 -2.39 14448.54 36.25 38.65" "Finolex Inds. 634.05 -15.50 -2.39 126.08 630.45 657.00" "SRF 5391.55 -126.05 -2.28 87.14 5373.00 5569.00" "3M India 21217.40 -489.95 -2.26 1.51 21163.55 21707.00" "WABCO India 5800.25 -133.85 -2.26 1.34 5770.10 6000.00" "Ambuja Cements 269.10 -6.20 -2.25 3689.72 269.05 276.90" "CG Consumer 387.80 -8.85 -2.23 501.11 386.00 399.75" "Zee Ent. 203.95 -4.60 -2.21 6088.81 203.05 209.60" "Minda Ind 552.95 -12.50 -2.21 53.44 550.00 578.50" "RIL 2034.75 -45.55 -2.19 5057.94 2027.60 2089.90" "RIL (PP) 1161.00 -25.90 -2.18 971.38 1155.30 1202.90" "GMR Infra 24.65 -0.55 -2.18 4723.61 24.60 25.20" "Coforge Ltd. 2515.40 -54.85 -2.13 68.75 2510.00 2586.55" "Rail Vikas Nigam 30.00 -0.65 -2.12 2814.61 29.70 30.95" "Tata Motors (DVR) 120.80 -2.60 -2.11 1403.78 120.25 124.50" "India Grid Trust (INVITS) 132.63 -2.86 -2.11 343.60 131.72 135.17" "PowerGrid 227.30 -4.90 -2.11 7051.29 227.05 233.90" "Dr. Reddys 4583.00 -98.45 -2.10 554.94 4582.00 4726.95" "Birla Corp. 850.50 -18.20 -2.10 57.23 848.00 875.65" "MphasiS 1653.55 -35.05 -2.08 146.06 1643.00 1693.85" "Bandhan Bank 330.30 -6.95 -2.06 3705.08 329.15 339.15" "GMM Pfaudler 4222.05 -88.05 -2.04 121.15 4160.00 4496.00" "Cadila Health 443.25 -9.15 -2.02 1258.60 440.65 451.00" "Rajesh Exports 499.95 -10.25 -2.01 135.09 499.25 519.70" "SBI 391.50 -8.05 -2.01 25323.96 390.00 401.00" "Aurobindo Pharm 870.65 -17.90 -2.01 1874.02 858.80 890.70" "RBL Bank 241.40 -4.85 -1.97 4965.47 241.00 248.05" "Wipro 421.50 -8.45 -1.97 4959.23 418.75 432.85" "HCL Tech 931.60 -18.55 -1.95 2191.00 931.00 951.45" "Jubilant Life 757.90 -14.80 -1.92 40.45 752.70 785.35" "ICICI Lombard 1465.05 -28.70 -1.92 387.93 1452.25 1498.00" "KPR Mill 903.05 -17.70 -1.92 10.11 896.00 925.00" "Nestle India 16068.80 -307.60 -1.88 136.43 16024.60 16530.00" "Info Edge 5073.25 -96.90 -1.87 321.22 5032.00 5160.00" "DCM Shriram 454.40 -8.65 -1.87 21.66 452.50 467.00" "ICICI Pru Life 476.35 -9.10 -1.87 1040.94 475.15 490.00" "Gujarat Gas 486.75 -9.10 -1.84 357.74 482.15 499.20" "Avenue Supermart 3044.45 -57.20 -1.84 114.78 3030.30 3108.40" "KEC Int. Ltd 423.90 -7.85 -1.82 51.02 421.20 432.75" "Can Fin Homes 506.25 -9.25 -1.79 95.44 502.00 513.85" "Godrej Prop 1496.00 -27.25 -1.79 331.02 1492.00 1534.00" "Bajaj Finance 5400.00 -97.95 -1.78 962.47 5391.00 5538.70" "BASF India 1992.20 -35.75 -1.76 22.17 1976.00 2038.10" "Varroc Engg 399.90 -7.10 -1.74 27.47 399.10 408.00" "Rites Ltd. 240.70 -4.20 -1.71 146.49 240.50 244.95" "Crisil 1924.05 -33.35 -1.70 5.92 1911.30 1967.20" "Alkyl Amines 5025.05 -86.40 -1.69 16.70 5010.55 5178.20" "Timken India 1290.00 -22.20 -1.69 6.41 1290.00 1318.80" "Elgi Equipments 161.05 -2.75 -1.68 34.37 160.80 164.60" "M&M Financial 205.10 -3.45 -1.65 4545.11 204.15 218.00" "Sheela Foam 2032.50 -33.85 -1.64 11.03 2011.40 2070.00" "Union Bank India 39.85 -0.65 -1.60 16621.99 39.55 41.30" "Atul Ltd 6473.55 -104.65 -1.59 8.14 6450.00 6580.00" "YES Bank 15.70 -0.25 -1.57 29512.21 15.70 16.00" "Sequent Sci 241.90 -3.85 -1.57 405.18 233.60 246.50" "Bayer Cropsc. 5125.00 -81.60 -1.57 4.47 5120.00 5190.05" "Concor 560.10 -8.85 -1.56 1024.60 556.20 568.95" "IRCTC 1649.25 -26.15 -1.56 801.76 1632.75 1675.00" "Apollo Tyres 234.85 -3.70 -1.55 5040.62 233.45 241.10" "Ceat 1562.50 -24.30 -1.53 57.79 1561.00 1605.00" "Aster DM Health 148.15 -2.30 -1.53 53.85 148.00 152.00" "P&G Health 7040.00 -109.20 -1.53 5.14 7005.00 7200.00" "Dixon Tech 19184.05 -295.20 -1.52 24.39 19100.00 19600.00" "Gujarat Fluorochem 528.70 -8.15 -1.52 39.79 525.10 543.80" "Sundaram Fin 2248.60 -34.80 -1.52 21.53 2230.55 2289.60" "Coromandel Int. 756.70 -11.70 -1.52 132.64 748.10 766.50" "AdityaBirlaFashion (PP) 131.00 -2.00 -1.50 5.86 130.00 133.00" "India Cements 162.95 -2.45 -1.48 499.80 162.65 166.55" "Motilal Oswal 608.00 -9.05 -1.47 28.60 608.00 616.20" "Alembic Pharma 889.15 -13.25 -1.47 372.53 870.00 898.95" "Alkem Lab 2834.00 -41.50 -1.44 26.94 2811.10 2879.90" "APL Apollo Tube 955.00 -13.95 -1.44 75.57 941.10 982.65" "Shriram Tran Fin 1384.35 -20.25 -1.44 1375.69 1381.10 1424.90" "Piramal Ent. 1813.95 -26.55 -1.44 544.78 1807.00 1839.90" "ABB India 1500.05 -21.55 -1.42 37.42 1491.00 1529.95" "EID Parry 314.80 -4.50 -1.41 106.07 313.60 324.60" "Granules India 325.00 -4.65 -1.41 569.11 323.25 331.30" "Graphite India 478.10 -6.80 -1.40 627.98 476.50 492.90" "ICICI Bank 615.40 -8.65 -1.39 10832.29 612.25 629.30" "Avanti Feeds 482.95 -6.70 -1.37 76.28 482.45 493.95" "Ipca Labs 1824.20 -25.35 -1.37 67.44 1821.10 1857.70" "Suven Pharma 484.40 -6.70 -1.36 134.78 483.95 492.85" "BHEL 39.85 -0.55 -1.36 18846.76 39.70 40.55" "NTPC 102.80 -1.40 -1.34 16323.09 101.55 106.30" "MRPL 37.10 -0.50 -1.33 617.79 37.05 38.25" "Blue Star Ltd 803.70 -10.80 -1.33 85.45 793.95 813.00" "V Mart Retail 2659.95 -35.70 -1.32 5.05 2651.15 2719.00" "MindTree 1666.10 -22.10 -1.31 185.48 1661.35 1710.00" "PI Industries 2231.25 -29.35 -1.30 40.38 2218.00 2269.50" "Persistent Sys 1650.45 -21.75 -1.30 32.77 1631.00 1679.50" "TeamLease Service 2994.45 -39.00 -1.29 6.70 2956.45 3095.00" "Manappuram Fin 170.00 -2.20 -1.28 2235.97 169.20 174.45" "JSW Energy 73.00 -0.95 -1.28 670.85 72.50 74.00" "HPCL 240.90 -3.10 -1.27 3544.33 240.40 248.30" "Dabur India 507.10 -6.35 -1.24 1033.40 506.50 517.30" "Aavas Financiers 2247.60 -28.15 -1.24 40.04 2215.05 2291.80" "Welspun India 68.35 -0.85 -1.23 179.04 68.00 69.50" "PNB Housing 439.00 -5.45 -1.23 762.72 431.65 454.40" "KIOCL 138.10 -1.70 -1.22 22.45 137.00 143.00" "ACC 1726.25 -21.10 -1.21 254.37 1720.00 1754.90" "Amber Enterprises 3120.95 -37.50 -1.19 30.09 3093.35 3174.95" "Vakrangee 53.95 -0.65 -1.19 1121.04 53.50 55.50" "Gillette India 5516.55 -65.85 -1.18 2.95 5503.20 5598.45" "NLC India 51.55 -0.60 -1.15 468.26 51.30 52.25" "CreditAccessGrameen 680.05 -7.85 -1.14 38.69 680.00 691.25" "Laurus Labs 361.20 -4.15 -1.14 771.61 360.55 369.00" "Mahanagar Gas 1169.70 -13.35 -1.13 353.26 1146.50 1179.70" "Indian Oil Corp 96.45 -1.10 -1.13 9624.39 96.40 98.50" "Tata Motors 308.35 -3.50 -1.12 24759.02 307.20 313.90" "J B Chem 1098.25 -12.25 -1.10 46.90 1096.25 1136.95" "Exide Inds. 202.20 -2.25 -1.10 1704.63 201.65 206.20" "Relaxo Footwear 864.50 -9.55 -1.09 35.16 861.05 874.00" "Exide Inds. 202.20 -2.25 -1.10 1704.63 201.65 206.20" "Relaxo Footwear 864.50 -9.55 -1.09 35.16 861.05 874.00" "Blue Dart Exp 4647.00 -51.05 -1.09 8.39 4575.25 4725.00" "Burger King India Ltd. 141.70 -1.55 -1.08 586.48 141.00 144.50" "PNB 41.60 -0.45 -1.07 99104.09 41.30 42.85" "Adani Trans 761.90 -8.25 -1.07 596.23 745.00 776.45" "Godrej Consumer 702.30 -7.40 -1.04 631.05 695.35 718.45" "IFB Industries 1250.00 -13.10 -1.04 22.59 1203.05 1272.75" "Hathway Cable 29.75 -0.30 -1.00 137.41 29.70 30.20" "HDFC AMC 2905.00 -29.25 -1.00 73.13 2878.20 2957.55" "Aegis Logistics 281.45 -2.80 -0.99 32.42 281.05 286.70" "SIS India 425.80 -4.25 -0.99 52.78 425.05 434.00" "InterGlobe 1550.25 -15.55 -0.99 546.71 1528.55 1565.80" "Bata India 1484.45 -14.55 -0.97 228.83 1483.00 1506.60" "Canara Bank 158.45 -1.55 -0.97 8216.40 157.20 161.00" "AIA Engineering 1850.25 -17.90 -0.96 56.70 1843.25 1880.05" "AstraZeneca 3591.00 -34.40 -0.95 9.21 3582.05 3654.10" "IndusInd Bank 1055.85 -10.05 -0.94 4014.07 1047.15 1067.10" "V-Guard Ind. 231.95 -2.15 -0.92 310.98 230.55 236.25" "Oberoi Realty 565.00 -5.20 -0.91 88.49 562.20 572.00" "Wockhardt 485.35 -4.35 -0.89 192.37 484.05 494.90" "Whirlpool India 2400.00 -20.90 -0.86 17.36 2380.85 2424.00" "Berger Paints 734.95 -6.30 -0.85 769.40 730.95 743.95" "Bajaj Finserv 10163.15 -87.30 -0.85 167.91 10158.70 10249.20" "Tata Power 90.35 -0.75 -0.82 20528.23 89.95 92.50" "Bombay Burmah 1182.45 -9.80 -0.82 15.43 1178.00 1203.30" "Sun TV 500.00 -4.10 -0.81 580.49 497.35 507.35" "Torrent Pharma 2477.20 -19.80 -0.79 196.84 2468.70 2501.65" "Symphony Ltd 1036.85 -8.15 -0.78 23.41 1026.90 1053.15" "Chola Inv Fin 526.20 -4.15 -0.78 6766.38 525.10 550.95" "Glenmark Pharma 478.55 -3.70 -0.77 678.08 476.65 485.80" "PFC 123.35 -0.95 -0.76 2697.58 122.60 126.65" "Radico Khaitan 551.00 -4.20 -0.76 120.65 543.30 559.05" "Shree Cements 27333.20 -209.25 -0.76 14.67 27284.75 27750.00" "Chambal Fert 233.10 -1.75 -0.75 825.99 232.10 237.00" "Siemens 1824.95 -13.75 -0.75 444.50 1804.30 1845.95" "MRF 87469.95 -650.15 -0.74 14.19 87201.10 88800.00" "Fortis Health 157.70 -1.15 -0.72 862.75 157.35 160.20" "United Spirits 552.40 -3.95 -0.71 847.02 551.50 559.95" "CESC 607.10 -4.30 -0.70 80.02 605.00 614.45" "Heidelberg Cem 227.00 -1.55 -0.68 498.99 226.40 234.35" "IndiaMART 8783.05 -53.75 -0.61 46.00 8650.50 8934.15" "Bajaj Holdings 3589.80 -21.20 -0.59 10.25 3572.45 3625.55" "GAIL 144.55 -0.85 -0.58 11653.06 143.10 145.50" "Hatsun Agro 712.80 -4.15 -0.58 9.01 707.00 720.55" "Ashok Leyland 122.70 -0.70 -0.57 13228.41 122.50 125.60" "TheRamcoCements 956.75 -5.45 -0.57 203.53 955.60 975.90" "Vinati Organics 1408.65 -7.75 -0.55 23.47 1400.00 1430.25" "Cummins India 765.65 -4.05 -0.53 306.24 760.30 776.95" "HEG Ltd 1485.85 -7.70 -0.52 177.38 1482.00 1530.00" "Pidilite Ind 1772.40 -8.95 -0.50 346.74 1758.40 1790.55" "JM Financial 91.30 -0.45 -0.49 345.15 91.20 92.40" "Hind. Unilever 2170.85 -10.25 -0.47 1281.07 2164.00 2205.00" "Adani Gas 495.45 -2.20 -0.44 839.79 493.00 510.20" "GSK Pharma 1444.35 -6.35 -0.44 9.59 1440.00 1457.00" "Castrol India 128.25 -0.55 -0.43 326.55 128.05 130.65" "Kansai Nerolac 560.00 -2.35 -0.42 60.62 555.15 565.75" "Edelweiss Fin 63.00 -0.25 -0.40 1150.00 62.35 63.60" "Page Industries 28190.00 -114.40 -0.40 9.51 28120.00 28519.85" "Trident Ltd 13.95 -0.05 -0.36 4729.81 13.85 14.20" "Indigo Paints Ltd. 2563.55 -9.05 -0.35 25.07 2562.25 2612.95" "Cipla 804.60 -2.75 -0.34 2238.84 803.35 817.50" "Marico 423.50 -1.35 -0.32 3372.82 422.05 433.95" "Dalmia Bharat 1471.65 -4.65 -0.31 72.21 1471.50 1508.35" "Pfizer 4510.95 -13.55 -0.30 19.18 4475.00 4590.00" "Petronet LNG 251.50 -0.75 -0.30 4290.26 251.00 258.00" "Sundaram Clayton 3560.35 -9.55 -0.27 0.84 3551.00 3688.80" "Bajaj Auto 3991.00 -10.10 -0.25 480.62 3926.85 4040.00" "ICICI Securities 401.95 -0.95 -0.24 142.52 400.10 406.35" "L&T Infotech 3813.50 -7.15 -0.19 27.02 3790.00 3854.95" "Au Small Fin Bank 1106.90 -2.10 -0.19 145.86 1097.15 1128.00" "Infibeam Avenues 88.95 -0.15 -0.17 268.81 88.40 89.95" "Nippon Life AMC 333.05 -0.50 -0.15 278.03 327.55 337.40" "Lupin 1020.60 -1.10 -0.11 1644.17 1006.10 1029.50" "Hemisphere Prop 179.00 -0.20 -0.11 668.41 171.00 188.00" "EIH 97.05 -0.10 -0.10 302.49 96.00 97.50" "Vardhman Text. 1114.50 -1.15 -0.10 7.27 1098.00 1119.15" "Infosys 1289.95 -1.35 -0.10 3157.09 1286.00 1308.55" "UTI AMC 583.45 -0.55 -0.09 169.75 581.85 594.80" "Adani Power 55.80 -0.05 -0.09 4354.64 55.70 57.35" "Bharti Airtel 580.80 -0.55 -0.09 8334.03 576.70 584.90" "P&G 12915.00 -11.70 -0.09 4.37 12895.10 13041.80" "Titan Company 1424.45 -1.10 -0.08 817.75 1416.00 1433.10" "JohnsonCtrlsHitachi 2460.00 -2.05 -0.08 2.85 2449.00 2475.00" "Balaji Amines 1605.00 -1.10 -0.07 59.16 1580.00 1640.00" "Biocon 403.75 -0.25 -0.06 1707.53 398.50 406.80" "United Brewerie 1216.95 -0.45 -0.04 202.08 1198.45 1219.45" "CholaFinHldg 589.35 -0.25 -0.04 42.39 587.00 602.70" "City Union Bank 164.40 -0.05 -0.03 478.61 163.05 165.90" "Godrej Agrovet 483.95 -0.10 -0.02 28.87 481.10 491.00" "Hemisphere Prop 179.00 -0.20 -0.11 668.41 171.00 188.00" "Biocon 403.55 -0.45 -0.11 1707.60 398.50 406.80" "Infosys 1289.85 -1.45 -0.11 3157.76 1286.00 1308.55" "EIH 97.05 -0.10 -0.10 302.49 96.00 97.50" "Vardhman Text. 1114.50 -1.15 -0.10 7.27 1098.00 1119.15" "Bharti Airtel 580.80 -0.55 -0.09 8335.97 576.70 584.90" "P&G 12915.00 -11.70 -0.09 4.37 12895.10 13041.80" "JohnsonCtrlsHitachi 2460.00 -2.05 -0.08 2.85 2449.00 2475.00" "Balaji Amines 1605.00 -1.10 -0.07 59.18 1580.00 1640.00" "United Brewerie 1216.95 -0.45 -0.04 202.09 1198.45 1219.45" "Titan Company 1424.95 -0.60 -0.04 820.81 1416.00 1433.10" "CholaFinHldg 589.35 -0.25 -0.04 42.39 587.00 602.70" "City Union Bank 164.40 -0.05 -0.03 478.61 163.05 165.90" "Asian Paints 2416.00 -0.45 -0.02 962.29 2412.80 2448.00" "Godrej Agrovet 483.95 -0.10 -0.02 28.87 481.10 491.00" ' subst = '' result = str.gsub(re, subst) # Print the result of the substitution puts result

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html