Skip to main content

How to extract Only Number and "." from a string?

Extract

string.replace(/[^0-9.]/g, Numbers"") from/ astring.replace(/[^a-zA-Z0-9.]/g, String'') in

Scenario Editor

UseLast updated: June 26, 2023

If you have any feedback on this patterntopic, whenplease acontact Scenarious Editorat test needs to capture numeric values from application text, such as prices, IDs, quantities, or decimal values.documentation@appvance.ai

  • Extract only the value required by the validation or downstream step.
  • Preserve decimal points only when the business value requires them.
  • Normalize currency symbols, commas, spaces, and labels before comparison.
  • Store extracted values with clear names when they are reused later.

Validation workflow

  1. Capture the source text from the page, response, or stored value.
  2. Apply the extraction rule to isolate the numeric value.
  3. Validate the extracted value against expected test data or business rules.
  4. Record the source text and extracted value when troubleshooting failures.

Last updated: September 20, 2026