CarlosCanto wrote: hi pixxxel, what do you mean? for some reason it works with (55) (54) and with ((55)), without the /g parameter Hi Carlos, your RegEx always is ok - but only, if not more than one source in a line exists. e.g.: your searchString = /\((.+)\)/; works fine, if Line1: 52(55) Line2: 52(54) Line3: and with 52((55)) But it's extremly dangerous to use, if more than one sources in a line exists Line4: 52(55) 52(54) and with 52((55)) or Line5: Test 51(No.1) Test 52(No.2) Test 53(No.3) At first: Please test this with searchString = /\((.+?)\)/; (.+? without /g) is not "greedy", but will not find all sources Second: Please test this with searchString = /\((.+?)\)/g; Only ((55)) will be difficult. I havent't tested before. In this case use better: searchString = /\((.+?)\){1,2}/g; I think you have the same result.
... View more