Based on exactly what you said:-
> "Selig Court, Flat 62, Beverley Gardens, London".match(/(Flat \d{1,4})/)[0]
'Flat 62'
> "Flat 62, Selig Court, Beverley Gardens, London".match(/(Flat \d{1,4})/)[0]
'Flat 62'
More Related Contents:
- Find list of strings that matches a pattern that start with a special character « and end with a special character »
- Javascript regex pattern for specific case
- Match exact string
- Regular expression to match non-ASCII characters?
- How can I parse a CSV string with JavaScript, which contains comma in data?
- How can I extract a number from a string in JavaScript?
- Fastest method to escape HTML tags as HTML entities?
- Split large string in n-size chunks in JavaScript
- Split a string by commas but ignore commas within double-quotes using Javascript
- Matching a Forward Slash with a regex
- How to find a number in a string using JavaScript?
- How can I concatenate regex literals in JavaScript?
- Javascript regex (negative) lookbehind not working in firefox
- JavaScript/regex: Remove text between parentheses
- JavaScript Regex, where to use escape characters?
- How to get possibly overlapping matches in a string
- javascript regex for password containing at least 8 characters, 1 number, 1 upper and 1 lowercase [duplicate]
- JavaScript Regular Expression Email Validation [duplicate]
- Extract image src from a string
- How to prevent invalid characters from being typed into input fields
- How to convert “camelCase” to “Camel Case”?
- Javascript unicode string, chinese character but no punctuation
- javascript regex to extract anchor text and URL from anchor tags
- Example of a regular expression for phone numbers
- Regex for parsing single key: values out of JSON in Javascript
- What’s the correct regex range for javascript’s regexes to match all the non word characters in any script?
- Regex to split camel case
- javascript split string by space, but ignore space in quotes (notice not to split by the colon too)
- Mask US phone number string with JavaScript
- Convert string to Pascal Case (aka UpperCamelCase) in Javascript