Skip to content

Tag: regex

regular expression to capture pdf data in nodejs

I have this code to get specific data from a pdf that is already converted to a string. basically, this is the string i have after that. I need a regular expression that captures de numbers only, I expect something like this: [1308906.95, 230942.51] this is my NodeJS code this is the code I have so far, I wou…

RegEx: lookahead get only first occurrence

(modified) Trying to get only first match of condition (?<=Location:.*?().*?(?=)) Here is data: and it returns: Is there a possibility to match only first occurrence of each match (so i need 3 matches: 1, 3 and 5) with lookbehind and lookahead and without grouping or other conditions? Found solution with a…

Multiple OR conditions for words in JavaScript regular expression

I trying to have a regular expression which is finding between two words but those words are not certain one. This is my text. I’m trying to find the word between Soyadı and Sınıfı, in this case ERTANĞA, but the word Sınıfı also can be no, numara or any number. This is what I did. [ıi] is for Turkish ch…

Extract Variables From String Regex

This might be a repeat question but I’m not sure how to look for the answer 😛 I’m trying to extract and remove variables from a string. The string might look like this: !text (<123456789>=<@$111111111>) (<7654312> = <@$222222222>) (🛠 =<@$3333333333>) Some text that I …

Regex to extract text from a string

Given the following string: What is a javascript regex to extract the “firstName” and “lastName”? What is a javascript regex to extract the content minus the “[~firstName.lastName]”? I’m rubbish with Regex. Answer You could target each name separately. match will retu…

JS Regex match Canadian postal code from string

I would like to find the alphanumeric canadian postal code from a string. A string such as H9B2R1|taco|salsa|taco or if encoded, H9B2R1%7Ctaco%7Csalsa%7Ctaco. The result I’m looking for is the trimmed postal code before any special characters and/or non-alphanumeric values. How to I use split or regex t…

Replace space with new line in vue js

I am trying to replace the spaces between the name to new line in vuejs but I am not able to achieve it. Please help me find where I going wrong. Right now the names are showing as but I want it to display as Below is the code. Answer You could do this entirely in CSS with word-spacing set